diff --git a/.github/resources.json b/.github/resources.json index e10b00c..cbafe44 100644 --- a/.github/resources.json +++ b/.github/resources.json @@ -38,7 +38,7 @@ "path": "src/module/bin/zashboard", "repo": "Zephyruso/zashboard", "assetPattern": "dist-no-fonts.zip", - "currentVersion": "v3.11.0" + "currentVersion": "v3.14.0" } ] } diff --git a/src/module/bin/ebpf-matcher b/src/module/bin/ebpf-matcher new file mode 100644 index 0000000..96cf62d Binary files /dev/null and b/src/module/bin/ebpf-matcher differ diff --git a/src/module/bin/zashboard/assets/ToolsPage-kA4wSGlA.js b/src/module/bin/zashboard/assets/ToolsPage-Cu0SeEcm.js similarity index 69% rename from src/module/bin/zashboard/assets/ToolsPage-kA4wSGlA.js rename to src/module/bin/zashboard/assets/ToolsPage-Cu0SeEcm.js index 0d03b42..ae763ad 100644 --- a/src/module/bin/zashboard/assets/ToolsPage-kA4wSGlA.js +++ b/src/module/bin/zashboard/assets/ToolsPage-Cu0SeEcm.js @@ -1,22 +1,18 @@ -import{o as g,c as x,a as p,t as Fo,b as zo,f as Wo,d as fe,u as Ot,e as ot,g as E,w as Be,v as ii,h as kt,F as ie,r as ve,i as hs,j as W,k as Y,l as J,m as A,n as ue,p as j,q as Re,s as Q,x as q,y as Ne,z as Bt,A as Uo,B as Bn,C as Fi,D as rt,E as Qs,G as $t,H as si,I as er,J as Vo,K as Dn,L as Ko,M as qo,N as tr,O as Yo,P as Ht,Q as ir,R as Ci,S as Xt,T as jo,U as Mn,V as Rn,W as Ln,X as Xo,Y as Go,Z as Pn,_ as cs,$ as Zo,a0 as ds,a1 as Jo,a2 as Qo,a3 as ea,a4 as Yi,a5 as ui,a6 as ta,a7 as ia,a8 as sa,a9 as ra,aa as na,ab as oa,ac as aa}from"./index-C6lj-lhL.js";function la(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"})])}function br(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"})])}function ha(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})])}function Tn(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})])}function An(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"})])}function ca(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}function da(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"})])}function ua(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"})])}function _a(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"})])}const fa=new Uint8Array([1]);class In{constructor(t){this.options=t;const i=t.baseUrl.replace(/^http/,"ws");this.socket=new WebSocket(`${i}/${t.service}/${t.method}`,["grpc-websockets"]),this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{let s=`content-type: application/grpc-web+proto\r -x-grpc-web: 1\r -`;t.secret&&(s+=`authorization: Bearer ${t.secret}\r -`),this.socket.send(new TextEncoder().encode(s)),this.opened=!0;for(const r of this.pendingSends)this.socket.send(r);this.pendingSends=[]},this.socket.onmessage=s=>{this.receive(new Uint8Array(s.data))},this.socket.onerror=()=>{this.end(null,"websocket connection failed")},this.socket.onclose=s=>{this.status?this.end(this.status):this.end(null,s.reason||"websocket closed unexpectedly")}}socket;buffer=new Uint8Array(0);pendingSends=[];opened=!1;ended=!1;headersSeen=!1;status=null;send(t){const i=Fo(this.options.requestSchema,zo(this.options.requestSchema,t)),s=new Uint8Array(6+i.length);s[2]=i.length>>>24&255,s[3]=i.length>>>16&255,s[4]=i.length>>>8&255,s[5]=i.length&255,s.set(i,6),this.enqueue(s)}finishSend(){this.enqueue(fa)}close(){this.ended=!0,this.socket.close()}enqueue(t){this.opened?this.socket.readyState===WebSocket.OPEN&&this.socket.send(t):this.pendingSends.push(t)}end(t,i){this.ended||(this.ended=!0,this.socket.close(),this.options.onEnd(t,i))}receive(t){if(this.ended)return;const i=new Uint8Array(this.buffer.length+t.length);for(i.set(this.buffer),i.set(t,this.buffer.length),this.buffer=i;this.buffer.length>=5;){const s=this.buffer[0],r=(this.buffer[1]<<24|this.buffer[2]<<16|this.buffer[3]<<8|this.buffer[4])>>>0;if(this.buffer.length<5+r)return;const n=this.buffer.slice(5,5+r);if(this.buffer=this.buffer.slice(5+r),(s&128)!==0)this.receiveMetadata(n);else try{this.options.onMessage(Wo(this.options.responseSchema,n))}catch(o){this.end(null,`decode response: ${String(o)}`);return}}}receiveMetadata(t){const i=new TextDecoder().decode(t),s={};for(const o of i.split(`\r -`)){const a=o.indexOf(":");a<=0||(s[o.slice(0,a).trim().toLowerCase()]=o.slice(a+1).trim())}if(!this.headersSeen&&!("grpc-status"in s)){this.headersSeen=!0;return}const r=Number(s["grpc-status"]??"2");let n=s["grpc-message"]??"";try{n=decodeURIComponent(n)}catch{}this.status={code:r,message:n},this.end(this.status)}}const pa={class:"p-2 sm:p-4"},ga={class:"mx-auto grid w-full max-w-5xl grid-cols-1 items-start gap-x-6 lg:grid-cols-2"},va={class:"flex flex-col gap-1"},ma={class:"settings-section-label"},ba={class:"settings-grid"},Sa={class:"setting-item"},wa={class:"setting-item-label"},ya=["disabled"],Ca={class:"setting-item"},ka={class:"setting-item-label"},xa=["disabled"],Ea={value:""},Ba=["value"],Da={class:"setting-item"},Ma={class:"setting-item-label"},Ra=["disabled"],La=["value"],Pa={class:"setting-item"},Ta={class:"setting-item-label"},Aa=["disabled"],Ia={class:"setting-item"},Na={class:"setting-item-label"},Oa=["disabled"],$a={class:"setting-item"},Ha={key:0,class:"text-error px-1 pt-2 text-sm"},Fa={key:1,class:"settings-grid mt-2"},za={key:2,class:"flex items-center gap-2 px-1 pt-2 text-sm opacity-70"},Wa={class:"flex flex-col gap-1"},Ua={class:"settings-section-label"},Va={class:"settings-grid"},Ka={class:"setting-item"},qa={class:"setting-item-label"},Ya=["disabled"],ja={class:"setting-item"},Xa={class:"setting-item-label"},Ga=["disabled"],Za={value:""},Ja=["value"],Qa={class:"setting-item"},el={key:0,class:"text-error px-1 pt-2 text-sm"},tl={key:1,class:"settings-grid mt-2"},il={key:1,class:"loading loading-spinner loading-xs"},sl={key:2},rl={key:1,class:"loading loading-spinner loading-xs"},nl={key:2},ol={key:2,class:"flex items-center gap-2 px-1 pt-2 text-sm opacity-70"},al="https://mensura.cdn-apple.com/api/v1/gm/config",ll="stun.voipgate.com:3478",hl=fe({__name:"NetworkToolsPanel",setup(e){const{t}=Ot(),i=fe({props:{label:String},setup:(w,{slots:S})=>()=>Re("div",{class:"setting-item"},[Re("div",{class:"setting-item-label"},w.label),Re("span",{class:"text-right font-medium break-all"},S.default?.())])}),s=fe({props:{pending:Boolean,value:String},setup:(w,{slots:S})=>()=>Re("span",{class:"inline-flex items-center gap-2"},[w.pending?Re("span",{class:"loading loading-spinner loading-xs"}):null,w.value,S.default?.()])}),r=fe({props:{accuracy:{type:Number,required:!0}},setup:w=>()=>{const S={2:["accuracyHigh","badge-success"],1:["accuracyMedium","badge-warning"]},[z,Z]=S[w.accuracy]??["accuracyLow","badge-error"];return Re("span",{class:`badge badge-xs ${Z}`},t(z))}}),n=()=>Bt(),o=Q(()=>Object.keys(Uo.value)),a=w=>{const S=Number(w);return S>=1e9?`${(S/1e9).toFixed(1)} Gbps`:S>=1e6?`${(S/1e6).toFixed(1)} Mbps`:S>=1e3?`${(S/1e3).toFixed(1)} kbps`:`${Math.round(S)} bps`},h=w=>({good:"badge-success",medium:"badge-warning",bad:"badge-error",neutral:"badge-ghost"})[w],l=w=>({2:"Endpoint Independent",3:"Address Dependent",4:"Address and Port Dependent"})[w]??"Unknown",d=w=>({1:"Endpoint Independent",2:"Address Dependent",3:"Address and Port Dependent"})[w]??"Unknown",c=w=>({2:"good",3:"medium",4:"bad"})[w]??"neutral",u=w=>({1:"good",2:"medium",3:"bad"})[w]??"neutral",v=q(al),_=q(""),m=q(!1),C=q(!1),M=q(20),F=q(!1),N=q(""),f=q(),R=Q(()=>f.value?.isFinal??!1);let B=null;const U=async()=>{const w=n();if(w){F.value=!0,N.value="",f.value=void 0,B=new AbortController;try{for await(const S of w.client.startNetworkQualityTest({configURL:v.value,outboundTag:_.value,http3:C.value,maxRuntimeSeconds:M.value,serial:m.value},{signal:B.signal}))if(f.value=S,S.error&&(N.value=S.error),S.isFinal)break}catch(S){B.signal.aborted||(N.value=String(S))}finally{F.value=!1}}},L=()=>{B?.abort(),F.value=!1},K=q(ll),I=q(""),H=q(!1),k=q(""),b=q();let P=null;const O=async()=>{const w=n();if(w){H.value=!0,k.value="",b.value=void 0,P=new AbortController;try{for await(const S of w.client.startSTUNTest({server:K.value,outboundTag:I.value},{signal:P.signal}))if(b.value=S,S.error&&(k.value=S.error),S.isFinal)break}catch(S){P.signal.aborted||(k.value=String(S))}finally{H.value=!1}}},D=()=>{P?.abort(),H.value=!1};return ot(()=>{B?.abort(),P?.abort()}),(w,S)=>(g(),x("div",pa,[p("div",ga,[p("section",va,[p("div",ma,E(w.$t("networkQuality")),1),p("div",ba,[p("div",Sa,[p("div",wa,E(w.$t("configURL")),1),Be(p("input",{class:"input input-sm w-48 max-w-full sm:w-80","onUpdate:modelValue":S[0]||(S[0]=z=>v.value=z),disabled:F.value},null,8,ya),[[ii,v.value]])]),p("div",Ca,[p("div",ka,E(w.$t("outbound")),1),Be(p("select",{class:"select select-sm min-w-24","onUpdate:modelValue":S[1]||(S[1]=z=>_.value=z),disabled:F.value},[p("option",Ea,E(w.$t("default")),1),(g(!0),x(ie,null,ve(o.value,z=>(g(),x("option",{key:z,value:z},E(z),9,Ba))),128))],8,xa),[[kt,_.value]])]),p("div",Da,[p("div",Ma,E(w.$t("maxRuntime")),1),Be(p("select",{class:"select select-sm min-w-24","onUpdate:modelValue":S[2]||(S[2]=z=>M.value=z),disabled:F.value},[(g(),x(ie,null,ve([20,30,60],z=>p("option",{key:z,value:z},E(z)+" s ",9,La)),64))],8,Ra),[[kt,M.value,void 0,{number:!0}]])]),p("div",Pa,[p("div",Ta,E(w.$t("serial")),1),Be(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":S[3]||(S[3]=z=>m.value=z),disabled:F.value},null,8,Aa),[[hs,m.value]])]),p("div",Ia,[p("div",Na,E(w.$t("http3")),1),Be(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":S[4]||(S[4]=z=>C.value=z),disabled:F.value},null,8,Oa),[[hs,C.value]])]),p("div",$a,[F.value?(g(),x("button",{key:1,class:"btn btn-sm ml-auto",onClick:L},E(w.$t("cancelTest")),1)):(g(),x("button",{key:0,class:"btn btn-neutral btn-sm ml-auto",onClick:U},E(w.$t("startTest")),1))])]),N.value?(g(),x("div",Ha,E(N.value),1)):W("",!0),f.value?(g(),x("div",Fa,[Y(A(i),{label:w.$t("idleLatency")},{default:J(()=>[ue(E(f.value.idleLatencyMs>0?`${f.value.idleLatencyMs} ms`:"-"),1)]),_:1},8,["label"]),Y(A(i),{label:w.$t("download")},{default:J(()=>[Y(A(s),{pending:F.value&&!R.value&&f.value.phase===1,value:f.value.downloadCapacity>0n?a(f.value.downloadCapacity):"-"},{default:J(()=>[R.value&&f.value.downloadCapacity>0n?(g(),j(A(r),{key:0,accuracy:f.value.downloadCapacityAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("upload")},{default:J(()=>[Y(A(s),{pending:F.value&&!R.value&&f.value.phase===2,value:f.value.uploadCapacity>0n?a(f.value.uploadCapacity):"-"},{default:J(()=>[R.value&&f.value.uploadCapacity>0n?(g(),j(A(r),{key:0,accuracy:f.value.uploadCapacityAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("downloadRPM")},{default:J(()=>[Y(A(s),{pending:F.value&&!R.value&&f.value.phase===1,value:f.value.downloadRPM>0?String(f.value.downloadRPM):"-"},{default:J(()=>[R.value&&f.value.downloadRPM>0?(g(),j(A(r),{key:0,accuracy:f.value.downloadRPMAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("uploadRPM")},{default:J(()=>[Y(A(s),{pending:F.value&&!R.value&&f.value.phase===2,value:f.value.uploadRPM>0?String(f.value.uploadRPM):"-"},{default:J(()=>[R.value&&f.value.uploadRPM>0?(g(),j(A(r),{key:0,accuracy:f.value.uploadRPMAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("elapsed")},{default:J(()=>[ue(E(`${(Number(f.value.elapsedMs)/1e3).toFixed(1)} s`),1)]),_:1},8,["label"])])):F.value?(g(),x("div",za,[S[7]||(S[7]=p("span",{class:"loading loading-spinner loading-xs"},null,-1)),ue(" "+E(w.$t("fetchingConfiguration")),1)])):W("",!0)]),p("section",Wa,[p("div",Ua,E(w.$t("stunTest"))+" - "+E(w.$t("natTypeDetection")),1),p("div",Va,[p("div",Ka,[p("div",qa,E(w.$t("serverField")),1),Be(p("input",{class:"input input-sm w-48 max-w-full sm:w-72","onUpdate:modelValue":S[5]||(S[5]=z=>K.value=z),disabled:H.value},null,8,Ya),[[ii,K.value]])]),p("div",ja,[p("div",Xa,E(w.$t("outbound")),1),Be(p("select",{class:"select select-sm min-w-24","onUpdate:modelValue":S[6]||(S[6]=z=>I.value=z),disabled:H.value},[p("option",Za,E(w.$t("default")),1),(g(!0),x(ie,null,ve(o.value,z=>(g(),x("option",{key:z,value:z},E(z),9,Ja))),128))],8,Ga),[[kt,I.value]])]),p("div",Qa,[H.value?(g(),x("button",{key:1,class:"btn btn-sm ml-auto",onClick:D},E(w.$t("cancelTest")),1)):(g(),x("button",{key:0,class:"btn btn-neutral btn-sm ml-auto",onClick:O},E(w.$t("startTest")),1))])]),k.value?(g(),x("div",el,E(k.value),1)):W("",!0),b.value?(g(),x("div",tl,[Y(A(i),{label:w.$t("externalAddress")},{default:J(()=>[ue(E(b.value.externalAddr||"-"),1)]),_:1},8,["label"]),Y(A(i),{label:w.$t("latency")},{default:J(()=>[ue(E(b.value.latencyMs>0?`${b.value.latencyMs} ms`:"-"),1)]),_:1},8,["label"]),b.value.isFinal&&!b.value.natTypeSupported?(g(),j(A(i),{key:0,label:w.$t("natTypeDetection")},{default:J(()=>[ue(E(w.$t("notSupportedByServer")),1)]),_:1},8,["label"])):(g(),x(ie,{key:1},[Y(A(i),{label:w.$t("natMapping")},{default:J(()=>[b.value.natMapping>0?(g(),x("span",{key:0,class:Ne(["badge badge-sm",h(c(b.value.natMapping))])},E(l(b.value.natMapping)),3)):H.value?(g(),x("span",il)):(g(),x("span",sl,"-"))]),_:1},8,["label"]),Y(A(i),{label:w.$t("natFiltering")},{default:J(()=>[b.value.natFiltering>0?(g(),x("span",{key:0,class:Ne(["badge badge-sm",h(u(b.value.natFiltering))])},E(d(b.value.natFiltering)),3)):H.value?(g(),x("span",rl)):(g(),x("span",nl,"-"))]),_:1},8,["label"])],64))])):H.value?(g(),x("div",ol,[S[8]||(S[8]=p("span",{class:"loading loading-spinner loading-xs"},null,-1)),ue(" "+E(w.$t("binding")),1)])):W("",!0)])])]))}});var Ct=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Ct||{});const cl=[0,1],Nn=[1,0],On=[2,3],$n=[3,2],dl={L:cl,M:Nn,Q:On,H:$n},ul=/^\d*$/,_l=/^[A-Z0-9 $%*+./:-]*$/,ji="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",sr=1,rr=40,Sr=3,fl=3,_i=40,pl=10,Hn=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Fn=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class gl{constructor(t,i,s,r){if(this.version=t,this.ecc=i,trr)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const n=Array.from({length:this.size}).fill(!1);for(let a=0;a0));this.drawFunctionPatterns();const o=this.addEccAndInterleave(s);if(this.drawCodewords(o),r===-1){let a=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);const l=this.getPenaltyScore();l=0&&t=0&&i>>9)*1335;const r=(i<<10|s)^21522;for(let n=0;n<=5;n++)this.setFunctionModule(8,n,Qe(r,n));this.setFunctionModule(8,7,Qe(r,6)),this.setFunctionModule(8,8,Qe(r,7)),this.setFunctionModule(7,8,Qe(r,8));for(let n=9;n<15;n++)this.setFunctionModule(14-n,8,Qe(r,n));for(let n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,Qe(r,n));for(let n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,Qe(r,n));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let s=0;s<12;s++)t=t<<1^(t>>>11)*7973;const i=this.version<<12|t;for(let s=0;s<18;s++){const r=Qe(i,s),n=this.size-11+s%3,o=Math.floor(s/3);this.setFunctionModule(n,o,r),this.setFunctionModule(o,n,r)}}drawFinderPattern(t,i){for(let s=-4;s<=4;s++)for(let r=-4;r<=4;r++){const n=Math.max(Math.abs(r),Math.abs(s)),o=t+r,a=i+s;o>=0&&o=0&&a{(u!==h-n||_>=a)&&c.push(v[u])});return c}drawCodewords(t){if(t.length!==Math.floor(us(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let s=this.size-1;s>=1;s-=2){s===6&&(s=5);for(let r=0;r>>3],7-(i&7)),i++)}}}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let i=0;i5&&t++):(this.finderPenaltyAddHistory(a,h),o||(t+=this.finderPenaltyCountPatterns(h)*_i),o=this.modules[n][l],a=1);t+=this.finderPenaltyTerminateAndCount(o,a,h)*_i}for(let n=0;n5&&t++):(this.finderPenaltyAddHistory(a,h),o||(t+=this.finderPenaltyCountPatterns(h)*_i),o=this.modules[l][n],a=1);t+=this.finderPenaltyTerminateAndCount(o,a,h)*_i}for(let n=0;no+(a?1:0),i);const s=this.size*this.size,r=Math.ceil(Math.abs(i*20-s*10)/s)-1;return t+=r*pl,t}getAlignmentPatternPositions(){if(this.version===1)return[];{const t=Math.floor(this.version/7)+2,i=this.version===32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,s=[6];for(let r=this.size-7;s.length0&&t[2]===i&&t[3]===i*3&&t[4]===i&&t[5]===i;return(s&&t[0]>=i*4&&t[6]>=i?1:0)+(s&&t[6]>=i*4&&t[0]>=i?1:0)}finderPenaltyTerminateAndCount(t,i,s){return t&&(this.finderPenaltyAddHistory(i,s),i=0),i+=this.size,this.finderPenaltyAddHistory(i,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(t,i){i[0]===0&&(t+=this.size),i.pop(),i.unshift(t)}}function it(e,t,i){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)i.push(e>>>s&1)}function Qe(e,t){return(e>>>t&1)!==0}class nr{constructor(t,i,s){if(this.mode=t,this.numChars=i,this.bitData=s,i<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}getData(){return this.bitData.slice()}}const vl=[1,10,12,14],ml=[2,9,11,13],bl=[4,8,16,16];function zn(e,t){return e[Math.floor((t+7)/17)+1]}function Wn(e){const t=[];for(const i of e)it(i,8,t);return new nr(bl,e.length,t)}function Sl(e){if(!Un(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let i=0;i=1<rr)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const i=Math.floor(e/7)+2;t-=(25*i-10)*i-55,e>=7&&(t-=36)}return t}function ki(e,t){return Math.floor(us(e)/8)-Hn[t[0]][e]*Fn[t[0]][e]}function xl(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let s=0;s0);for(const s of e){const r=s^i.shift();i.push(0),t.forEach((n,o)=>i[o]^=_s(n,r))}return i}function _s(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let i=0;for(let s=7;s>=0;s--)i=i<<1^(i>>>7)*285,i^=(t>>>s&1)*e;return i}function Bl(e,t,i=1,s=40,r=-1,n=!0){if(!(sr<=i&&i<=s&&s<=rr)||r<-1||r>7)throw new RangeError("Invalid value");let o,a;for(o=i;;o++){const c=ki(o,t)*8,u=Cl(e,o);if(u<=c){a=u;break}if(o>=s)throw new RangeError("Data too long")}for(const c of[Nn,On,$n])n&&a<=ki(o,c)*8&&(t=c);const h=[];for(const c of e){it(c.mode[0],4,h),it(c.numChars,zn(c.mode,o),h);for(const u of c.getData())h.push(u)}const l=ki(o,t)*8;it(0,Math.min(4,l-h.length),h),it(0,(8-h.length%8)%8,h);for(let c=236;h.length0);return h.forEach((c,u)=>d[u>>>3]|=c<<7-(u&7)),new gl(o,t,d,r)}function Dl(e,t){const{ecc:i="L",boostEcc:s=!1,minVersion:r=1,maxVersion:n=40,maskPattern:o=-1,border:a=1}=t||{},h=typeof e=="string"?yl(e):Array.isArray(e)?[Wn(e)]:void 0;if(!h)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const l=Bl(h,dl[i],r,n,o,s),d=Ml({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},a);return t?.invert&&(d.data=d.data.map(c=>c.map(u=>!u))),t?.onEncoded?.(d),d}function Ml(e,t=1){if(!t)return e;const{size:i}=e,s=i+t*2;e.size=s,e.data.forEach(n=>{for(let o=0;o!1)),e.data.push(Array.from({length:s},o=>!1));const r=Ct.Border;e.types.forEach(n=>{for(let o=0;or)),e.types.push(Array.from({length:s},o=>r));return e}const Rl=["viewBox","aria-label"],Ll=["d"],Pl=fe({__name:"QRCodeView",props:{value:{}},setup(e){const t=e,i=Q(()=>Dl(t.value,{border:2})),s=Q(()=>{const r=[];return i.value.data.forEach((n,o)=>n.forEach((a,h)=>{a&&r.push(`M${h} ${o}h1v1h-1z`)})),r.join("")});return(r,n)=>(g(),x("svg",{class:"h-auto w-full max-w-64 rounded bg-white p-3",viewBox:`0 0 ${i.value.size} ${i.value.size}`,role:"img","aria-label":e.value},[p("path",{d:s.value,fill:"#000","shape-rendering":"crispEdges"},null,8,Ll)],8,Rl))}}),fs="root",xi="xterm-256color",Dt=Bn("config/tailscale-ssh",{}),Tl=(e,t)=>{Dt.value={...Dt.value,[e]:t}},wr=e=>e?.userGroups.flatMap(t=>t.peers)??[],nt=e=>e?e.dnsName!==""?e.dnsName.split(".")[0]:e.hostName||e.tailscaleIPs[0]||e.stableID:"",Kn=e=>e.tailscaleIPs.find(t=>!t.includes(":"))??e.tailscaleIPs[0]??e.dnsName,qn=e=>e.online&&e.sshHostKeys.length>0&&e.tailscaleIPs.length>0,Yn=(e,t,i,s)=>({endpointTag:e,peerAddress:Kn(t),peerName:nt(t),username:i,terminalType:s,hostKeys:t.sshHostKeys}),Al={class:"flex flex-col gap-3"},Il=["placeholder"],Nl={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},Ol={class:"setting-item-label"},$l=["onClick"],Hl={class:"setting-item-label flex min-w-0 items-center gap-2"},Fl={class:"truncate text-sm font-medium"},zl={class:"text-base-content/40 truncate text-xs"},Wl=fe({__name:"TailscaleExitNodeDialog",props:si({endpoint:{},candidates:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,i=Fi(e,"modelValue"),s=er("searchEl"),r=q(""),n=Q(()=>t.endpoint.exitNode?.stableID??""),o=Q(()=>{const h=r.value.trim().toLowerCase();return h===""?t.candidates:t.candidates.filter(l=>nt(l).toLowerCase().includes(h)||l.hostName.toLowerCase().includes(h)||l.dnsName.toLowerCase().includes(h)||l.tailscaleIPs.some(d=>d.includes(h)))});rt(i,async h=>{h&&(r.value="",await Qs(),s.value?.focus())});const a=h=>{Bt()?.client.setTailscaleExitNode({endpointTag:t.endpoint.endpointTag,stableID:h}),i.value=!1};return(h,l)=>(g(),j($t,{modelValue:i.value,"onUpdate:modelValue":l[2]||(l[2]=d=>i.value=d),title:h.$t("exitNode")},{default:J(()=>[p("div",Al,[Be(p("input",{ref_key:"searchEl",ref:s,class:"input input-sm w-full rounded-lg",placeholder:h.$t("search"),"onUpdate:modelValue":l[0]||(l[0]=d=>r.value=d)},null,8,Il),[[ii,r.value]]),p("div",Nl,[p("button",{class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:l[1]||(l[1]=d=>a(""))},[p("span",Ol,E(h.$t("disabledLabel")),1),n.value===""?(g(),j(A(br),{key:0,class:"text-primary h-4 w-4 shrink-0"})):W("",!0)]),(g(!0),x(ie,null,ve(o.value,d=>(g(),x("button",{key:d.stableID,class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:c=>a(d.stableID)},[p("span",{class:Ne(["inline-block h-2 w-2 shrink-0 rounded-full",d.online?"bg-success":"bg-base-content/20"])},null,2),p("span",Hl,[p("span",Fl,E(A(nt)(d)),1),p("span",zl,E(d.tailscaleIPs[0]),1)]),n.value===d.stableID?(g(),j(A(br),{key:0,class:"text-primary h-4 w-4 shrink-0"})):W("",!0)],8,$l))),128))])])]),_:1},8,["modelValue","title"]))}}),Ul=["height","viewBox"],Vl=["points","fill"],Kl=["points","stroke"],yr=300,ql=fe({__name:"PingSparkline",props:{data:{},height:{default:56},color:{default:"currentColor"},capacity:{default:30}},setup(e){const t=e,i=Q(()=>{const n=Math.max(...t.data,1),o=yr/Math.max(t.capacity-1,1),a=Math.max(0,t.capacity-t.data.length);return t.data.map((h,l)=>{const d=(a+l)*o,c=t.height-3-h/(n*1.2)*(t.height-6);return`${d.toFixed(1)},${c.toFixed(1)}`})}),s=Q(()=>i.value.join(" ")),r=Q(()=>{const n=i.value,o=n[0].split(",")[0],a=n[n.length-1].split(",")[0];return`${o},${t.height} ${n.join(" ")} ${a},${t.height}`});return(n,o)=>(g(),x("svg",{width:"100%",height:e.height,viewBox:`0 0 ${yr} ${e.height}`,preserveAspectRatio:"none",class:"block"},[i.value.length>1?(g(),x(ie,{key:0},[p("polygon",{points:r.value,fill:e.color,opacity:"0.1"},null,8,Vl),p("polyline",{points:s.value,fill:"none",stroke:e.color,"stroke-width":"1.8","stroke-linejoin":"round","stroke-linecap":"round","vector-effect":"non-scaling-stroke"},null,8,Kl)],64)):W("",!0)],8,Ul))}}),Yl={class:"flex flex-col gap-4 text-sm"},jl={class:"flex flex-col gap-1"},Xl={class:"text-base-content/45 px-1 text-xs font-medium"},Gl={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},Zl={key:0,class:"flex flex-col gap-1"},Jl={class:"flex items-center justify-between"},Ql={class:"text-base-content/45 px-1 text-xs font-medium"},eh={key:0,class:"text-error py-1"},th={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},ih={key:2,class:"py-1 opacity-60"},sh={key:3,class:"py-1 opacity-60"},rh={class:"flex flex-col gap-1"},nh={class:"text-base-content/45 px-1 text-xs font-medium"},oh={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},ah={key:1,class:"flex justify-end gap-2 pt-1"},lh=fe({__name:"TailscalePeerDialog",props:si({endpoint:{},peer:{},isSelf:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:si(["connectSsh","editSsh"],["update:modelValue"]),setup(e,{emit:t}){const i=e,s=Fi(e,"modelValue"),r=t,{t:n}=Ot(),{copy:o}=Vo(),a=fe({props:{label:String},setup:(L,{slots:K})=>()=>Re("div",{class:"flex min-h-11 items-center justify-between gap-3 px-4 py-2"},[Re("span",{class:"text-base-content/55"},L.label),Re("span",{class:"text-right break-all"},K.default?.())])}),h=L=>{L&&(o(L),tr({content:"copySuccess",type:"alert-success",timeout:2e3}))},l=fe({props:{label:String,value:String},setup:L=>()=>Re("div",{class:"flex min-h-11 items-center justify-between gap-3 px-4 py-2"},[Re("span",{class:"text-base-content/55"},L.label),Re("div",{class:"flex items-center gap-2"},[Re("span",{class:"text-right break-all"},L.value),Re("button",{class:"btn btn-ghost btn-xs btn-circle shrink-0",onClick:()=>h(L.value),title:n("copy"),"aria-label":n("copy")},Re(An,{class:"h-4 w-4"}))])])}),d=Q(()=>i.peer.dnsName.replace(/\.$/,"")),c=Q(()=>i.peer.tailscaleIPs.find(L=>!L.includes(":"))),u=Q(()=>i.peer.tailscaleIPs.find(L=>L.includes(":"))),v=L=>qo(Number(L)*1e3).fromNow(),_=Q(()=>i.peer.expired?n("expired"):i.peer.keyExpiry>0n?v(i.peer.keyExpiry):n("disabledLabel")),m=Q(()=>!i.isSelf&&i.peer.online&&i.peer.sshHostKeys.length>0),C=Q(()=>Dt.value[i.peer.stableID]?.remember??!1),M=q(!1),F=q(""),N=q(),f=q([]);let R=null;const B=async()=>{const L=Bt();if(L){M.value=!0,F.value="",N.value=void 0,f.value=[],R=new AbortController;try{for await(const K of L.client.startTailscalePing({endpointTag:i.endpoint.endpointTag,peerIP:i.peer.tailscaleIPs[0]??""},{signal:R.signal})){if(K.error){F.value=K.error;continue}N.value=K;const I=f.value.concat(K.latencyMs);f.value=I.length>30?I.slice(I.length-30):I}}catch(K){R.signal.aborted||(F.value=String(K))}finally{M.value=!1}}},U=()=>{R?.abort(),M.value=!1};return rt(s,L=>{L||U()}),ot(U),(L,K)=>(g(),j($t,{modelValue:s.value,"onUpdate:modelValue":K[3]||(K[3]=I=>s.value=I),title:A(nt)(e.peer)},{"title-right":J(()=>[p("span",{class:Ne(["ml-2 rounded-full px-2 py-0.5 text-[0.65rem] font-medium",e.peer.online?"bg-success/15 text-success":"bg-base-content/10 text-base-content/60"])},E(e.peer.online?L.$t("connected"):L.$t("notConnected")),3)]),default:J(()=>[p("div",Yl,[p("section",jl,[p("div",Xl,E(L.$t("addresses")),1),p("div",Gl,[d.value?(g(),j(A(l),{key:0,label:"MagicDNS",value:d.value},null,8,["value"])):W("",!0),Y(A(l),{label:L.$t("hostnameLabel"),value:e.peer.hostName},null,8,["label","value"]),c.value?(g(),j(A(l),{key:1,label:"IPv4",value:c.value},null,8,["value"])):W("",!0),u.value?(g(),j(A(l),{key:2,label:"IPv6",value:u.value},null,8,["value"])):W("",!0)])]),!e.isSelf&&e.peer.online?(g(),x("section",Zl,[p("div",Jl,[p("span",Ql,E(L.$t("ping")),1),p("button",{class:"btn btn-ghost btn-xs",onClick:K[0]||(K[0]=I=>M.value?U():B())},[(g(),j(Dn(M.value?A(_a):A(Ko)),{class:"h-4 w-4"}))])]),F.value?(g(),x("div",eh,E(F.value),1)):W("",!0),N.value?(g(),x(ie,{key:1},[p("div",th,[Y(A(a),{label:N.value.isDirect?L.$t("directConnection"):L.$t("derpRelayed")},{default:J(()=>[ue(E(N.value.latencyMs.toFixed(1))+" ms ",1)]),_:1},8,["label"]),!N.value.isDirect&&N.value.derpRegionCode?(g(),j(A(a),{key:0,label:L.$t("derpRegion")},{default:J(()=>[ue(E(N.value.derpRegionCode),1)]),_:1},8,["label"])):W("",!0),N.value.isDirect&&N.value.endpoint?(g(),j(A(a),{key:1,label:L.$t("endpointLabel")},{default:J(()=>[ue(E(N.value.endpoint),1)]),_:1},8,["label"])):W("",!0)]),Y(ql,{data:f.value,color:N.value.isDirect?"var(--color-success)":"var(--color-info)",class:"text-primary mt-1"},null,8,["data","color"])],64)):M.value?(g(),x("div",ih,E(L.$t("connecting")),1)):(g(),x("div",sh,E(L.$t("noData")),1))])):W("",!0),p("section",rh,[p("div",nh,E(L.$t("detailsLabel")),1),p("div",oh,[e.peer.os?(g(),j(A(a),{key:0,label:L.$t("osLabel")},{default:J(()=>[ue(E(e.peer.os),1)]),_:1},8,["label"])):W("",!0),Y(A(a),{label:L.$t("keyExpiry")},{default:J(()=>[ue(E(_.value),1)]),_:1},8,["label"]),!e.peer.online&&e.peer.lastSeen>0n?(g(),j(A(a),{key:1,label:L.$t("lastSeen")},{default:J(()=>[ue(E(v(e.peer.lastSeen)),1)]),_:1},8,["label"])):W("",!0),e.peer.exitNodeOption?(g(),j(A(a),{key:2,label:L.$t("exitNode")},{default:J(()=>[ue(E(e.peer.exitNode?L.$t("activeLabel"):L.$t("availableLabel")),1)]),_:1},8,["label"])):W("",!0),e.peer.shareeNode?(g(),j(A(a),{key:3,label:L.$t("sharedIn")},{default:J(()=>[ue(E(L.$t("yes")),1)]),_:1},8,["label"])):W("",!0)])]),m.value?(g(),x("div",ah,[C.value?(g(),x("button",{key:0,class:"btn btn-sm rounded-lg",onClick:K[1]||(K[1]=I=>r("editSsh"))},E(L.$t("editSSHConfiguration")),1)):W("",!0),p("button",{class:"btn btn-primary btn-sm rounded-lg",onClick:K[2]||(K[2]=I=>r("connectSsh"))},[Y(A(Tn),{class:"h-4 w-4"}),ue(" "+E(L.$t("connectViaSSH")),1)])])):W("",!0)])]),_:1},8,["modelValue","title"]))}}),hh={class:"flex flex-col gap-3"},ch={class:"text-base-content/55 px-1 text-sm"},dh={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},uh={class:"setting-item"},_h={class:"setting-item-label"},fh={class:"setting-item"},ph={class:"setting-item-label"},gh={class:"setting-item cursor-pointer"},vh={class:"setting-item-label"},mh={class:"flex justify-end gap-2 pt-1"},bh=["disabled"],Sh=fe({__name:"TailscaleSSHDialog",props:si({peer:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:si(["connect"],["update:modelValue"]),setup(e,{emit:t}){const i=e,s=Fi(e,"modelValue"),r=t,n=er("usernameEl"),o=q(fs),a=q(xi),h=q(!1);rt(s,async d=>{if(!d)return;const c=Dt.value[i.peer.stableID];o.value=c?.username??fs,a.value=c?.terminalType??xi,h.value=c?.remember??!1,await Qs(),n.value?.focus()});const l=()=>{const d=o.value.trim();d!==""&&(r("connect",d,a.value.trim()||xi,h.value),s.value=!1)};return(d,c)=>(g(),j($t,{modelValue:s.value,"onUpdate:modelValue":c[4]||(c[4]=u=>s.value=u),title:d.$t("sshConfiguration")},{default:J(()=>[p("div",hh,[p("div",ch,E(A(nt)(e.peer)),1),p("div",dh,[p("div",uh,[p("span",_h,E(d.$t("username")),1),Be(p("input",{ref_key:"usernameEl",ref:n,class:"input input-ghost input-sm w-40 text-right","onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),onKeydown:Yo(l,["enter"])},null,544),[[ii,o.value]])]),p("div",fh,[p("span",ph,E(d.$t("terminalType")),1),Be(p("input",{class:"input input-ghost input-sm w-40 text-right","onUpdate:modelValue":c[1]||(c[1]=u=>a.value=u)},null,512),[[ii,a.value]])]),p("label",gh,[p("span",vh,E(d.$t("rememberSSHOptions")),1),Be(p("input",{type:"checkbox",class:"toggle toggle-sm","onUpdate:modelValue":c[2]||(c[2]=u=>h.value=u)},null,512),[[hs,h.value]])])]),p("div",mh,[p("button",{class:"btn btn-sm rounded-lg",onClick:c[3]||(c[3]=u=>s.value=!1)},E(d.$t("cancel")),1),p("button",{class:"btn btn-primary btn-sm rounded-lg",disabled:o.value.trim()==="",onClick:l},E(d.$t("connect")),9,bh)])])]),_:1},8,["modelValue","title"]))}}),wh={class:"mx-auto flex max-w-2xl flex-col p-2 sm:p-4"},yh={key:0,class:"text-base-content/50 p-12 text-center text-sm"},Ch={class:"settings-section-label flex items-center justify-between gap-2 normal-case"},kh={class:"flex items-center gap-2 tracking-normal"},xh={class:"text-base-content/90 text-sm font-semibold"},Eh=["onClick"],Bh={class:"settings-grid"},Dh=["onClick"],Mh={class:"setting-item-label"},Rh={class:"text-base-content/50 truncate text-sm"},Lh=["onClick"],Ph={class:"setting-item-label"},Th={class:"text-base-content/50 truncate text-sm"},Ah={key:2,class:"setting-item"},Ih={class:"setting-item-label"},Nh={class:"text-base-content/50 truncate text-sm"},Oh={key:3,class:"setting-item"},$h={class:"setting-item-label shrink-0"},Hh=["href"],Fh=["title","onClick"],zh={class:"settings-section-label"},Wh={class:"settings-grid"},Uh=["onClick"],Vh={class:"truncate text-sm font-medium"},Kh={class:"text-base-content/40 truncate text-xs"},qh={key:1,class:"bg-base-content/8 text-base-content/60 shrink-0 rounded-full px-2 py-0.5 text-[0.65rem] font-medium"},Yh={key:2,class:"bg-error/15 text-error shrink-0 rounded-full px-2 py-0.5 text-[0.65rem] font-medium"},jh=["title","onClick"],Xh={key:0,class:"flex flex-col items-center gap-3"},Gh=["href"],Zh=fe({__name:"TailscalePanel",emits:["ssh"],setup(e,{emit:t}){const i=t,s=q([]);let r=null;const n=I=>I.userGroups.filter(H=>H.peers.length>0),o=I=>I.backendState==="Running"?I.userGroups.flatMap(H=>H.peers).filter(H=>H.exitNodeOption):[],a=I=>{switch(I){case"Running":return"bg-success/15 text-success";case"NeedsLogin":case"NeedsMachineAuth":return"bg-error/15 text-error";case"Starting":return"bg-warning/15 text-warning";default:return"bg-base-content/10 text-base-content/60"}},h=I=>{Bt()?.client.tailscaleLogout({endpointTag:I})},l=q(),d=q(!1),c=(I,H,k)=>{l.value={endpoint:I,peer:H,isSelf:k},d.value=!0},u=q(),v=q(!1),_=I=>{u.value={endpoint:I,candidates:o(I)},v.value=!0},m=q(),C=q(!1),M=I=>{m.value=I,C.value=!0},F=q(),N=q(!1),f=(I,H)=>{F.value={endpoint:I,peer:H},N.value=!0},R=(I,H,k,b)=>{i("ssh",Yn(I.endpointTag,H,k,b)),d.value=!1},B=(I,H)=>{const k=Dt.value[H.stableID];k?.remember?R(I,H,k.username,k.terminalType):f(I,H)},U=()=>{const I=l.value;I&&(d.value=!1,B(I.endpoint,I.peer))},L=()=>{const I=l.value;I&&(d.value=!1,f(I.endpoint,I.peer))},K=(I,H,k)=>{const b=F.value;b&&(k&&Tl(b.peer.stableID,{username:I,terminalType:H,remember:k}),R(b.endpoint,b.peer,I,H))};return Ht(()=>{const I=Bt();I&&(r=ir(H=>I.client.subscribeTailscaleStatus({},{signal:H}),H=>s.value=H.endpoints))}),ot(()=>r?.close()),(I,H)=>(g(),x("div",wh,[s.value.length===0?(g(),x("div",yh,E(I.$t("noEndpoints")),1)):W("",!0),(g(!0),x(ie,null,ve(s.value,k=>(g(),x(ie,{key:k.endpointTag},[p("div",Ch,[p("span",kh,[p("span",xh,E(k.endpointTag||"Tailscale"),1),p("span",{class:Ne(["rounded-full px-2 py-0.5 text-[0.65rem] font-medium tracking-normal",a(k.backendState)])},E(k.backendState||I.$t("unknown")),3)]),k.keyAuth?W("",!0):(g(),x("button",{key:0,class:"text-error/90 hover:text-error flex items-center gap-1 text-xs font-medium tracking-normal",onClick:b=>h(k.endpointTag)},[Y(A(la),{class:"h-4 w-4"}),ue(" "+E(I.$t("logout")),1)],8,Eh))]),p("div",Bh,[k.self?(g(),x("button",{key:0,class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:b=>c(k,k.self,!0)},[p("span",Mh,E(I.$t("thisDevice")),1),p("span",Rh,E(A(nt)(k.self)),1),Y(A(Ci),{class:"text-base-content/25 h-4 w-4 shrink-0"})],8,Dh)):W("",!0),o(k).length>0?(g(),x("button",{key:1,class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:b=>_(k)},[p("span",Ph,E(I.$t("exitNode")),1),p("span",Th,E(k.exitNode?A(nt)(k.exitNode):I.$t("disabledLabel")),1),Y(A(Ci),{class:"text-base-content/25 h-4 w-4 shrink-0"})],8,Lh)):W("",!0),k.networkName?(g(),x("div",Ah,[p("span",Ih,E(I.$t("networkLabel")),1),p("span",Nh,E(k.networkName),1)])):W("",!0),k.authURL?(g(),x("div",Oh,[p("span",$h,E(I.$t("authURL")),1),p("a",{href:k.authURL,target:"_blank",class:"link link-primary truncate text-sm"},E(k.authURL),9,Hh),p("button",{class:"text-base-content/40 hover:text-base-content/70 shrink-0 transition-colors",title:I.$t("showAuthQR"),onClick:b=>M(k)},[Y(A(da),{class:"h-5 w-5"})],8,Fh)])):W("",!0)]),(g(!0),x(ie,null,ve(n(k),b=>(g(),x(ie,{key:b.userID.toString()},[p("div",zh,E(b.displayName||b.loginName||I.$t("peers")),1),p("div",Wh,[(g(!0),x(ie,null,ve(b.peers,P=>(g(),x("div",{key:P.stableID,class:"setting-item"},[p("button",{class:"flex min-w-0 flex-1 items-center gap-2.5 text-left",onClick:O=>c(k,P,!1)},[p("span",{class:Ne(["inline-block h-2 w-2 shrink-0 rounded-full",P.online?"bg-success":"bg-base-content/20"])},null,2),p("span",Vh,E(A(nt)(P)),1),p("span",Kh,E(P.tailscaleIPs[0]),1)],8,Uh),P.exitNode||P.exitNodeOption?(g(),x("span",{key:0,class:Ne(["shrink-0 rounded-full px-2 py-0.5 text-[0.65rem] font-medium",P.exitNode?"bg-primary/15 text-primary":"bg-info/15 text-info"])},E(I.$t("exitNode")),3)):W("",!0),P.shareeNode?(g(),x("span",qh,E(I.$t("sharedIn")),1)):W("",!0),P.expired?(g(),x("span",Yh,E(I.$t("expired")),1)):W("",!0),A(qn)(P)?(g(),x("button",{key:3,class:"text-primary hover:bg-primary/10 shrink-0 rounded-md p-1 transition-colors",title:I.$t("connectViaSSH"),onClick:O=>B(k,P)},[Y(A(Tn),{class:"h-4 w-4"})],8,jh)):W("",!0),Y(A(Ci),{class:"text-base-content/25 h-4 w-4 shrink-0 cursor-pointer",onClick:O=>c(k,P,!1)},null,8,["onClick"])]))),128))])],64))),128))],64))),128)),l.value?(g(),j(lh,{key:1,modelValue:d.value,"onUpdate:modelValue":H[0]||(H[0]=k=>d.value=k),endpoint:l.value.endpoint,peer:l.value.peer,"is-self":l.value.isSelf,onConnectSsh:U,onEditSsh:L},null,8,["modelValue","endpoint","peer","is-self"])):W("",!0),u.value?(g(),j(Wl,{key:2,modelValue:v.value,"onUpdate:modelValue":H[1]||(H[1]=k=>v.value=k),endpoint:u.value.endpoint,candidates:u.value.candidates},null,8,["modelValue","endpoint","candidates"])):W("",!0),F.value?(g(),j(Sh,{key:3,modelValue:N.value,"onUpdate:modelValue":H[2]||(H[2]=k=>N.value=k),peer:F.value.peer,onConnect:K},null,8,["modelValue","peer"])):W("",!0),Y($t,{modelValue:C.value,"onUpdate:modelValue":H[3]||(H[3]=k=>C.value=k),title:I.$t("authURL")},{default:J(()=>[m.value?(g(),x("div",Xh,[Y(Pl,{value:m.value.authURL},null,8,["value"]),p("a",{href:m.value.authURL,target:"_blank",class:"link link-primary text-xs break-all"},E(m.value.authURL),9,Gh)])):W("",!0)]),_:1},8,["modelValue","title"])]))}}),St="\x1B",Jh=[{kind:"special",id:"esc",label:"esc"},{kind:"special",id:"tab",label:"tab"},{kind:"modifier",mod:"ctrl",label:"⌃"},{kind:"modifier",mod:"alt",label:"⌥"},{kind:"divider"},{kind:"special",id:"left",label:"←"},{kind:"special",id:"up",label:"↑"},{kind:"special",id:"down",label:"↓"},{kind:"special",id:"right",label:"→"},{kind:"divider"},{kind:"text",char:"|"},{kind:"text",char:"/"},{kind:"text",char:"~"},{kind:"text",char:"-"},{kind:"text",char:"_"},{kind:"text",char:"`"},{kind:"text",char:"'"},{kind:"text",char:'"'},{kind:"paste"}],Qh=e=>{if(e.length!==1)return null;if(e===" ")return"\0";const t=e.toUpperCase().charCodeAt(0);return t>=64&&t<=95?String.fromCharCode(t&31):null},Cr=(e,t)=>{let i=e;if(t.ctrl!=="off"&&e.length===1){const s=Qh(e);s!==null&&(i=s)}return t.alt!=="off"&&(i=St+i),i},ec={up:"A",down:"B",right:"C",left:"D"},tc=(e,t)=>{if(e==="esc")return t.alt!=="off"?St+St:St;if(e==="tab")return t.alt!=="off"?St+" ":" ";const i=ec[e],s=1+(t.alt!=="off"?2:0)+(t.ctrl!=="off"?4:0);return s===1?St+"["+i:St+"[1;"+s+i},ic=e=>e.ctrl!=="off"||e.alt!=="off",sc=(e,t)=>{switch(e){case"off":return"armed";case"armed":return t?"locked":"off";case"locked":return"off"}},rc=(e,t,i)=>({...e,[t]:sc(e[t],i)}),Xi=e=>({ctrl:e.ctrl==="armed"?"off":e.ctrl,alt:e.alt==="armed"?"off":e.alt}),nc=["aria-label"],oc={key:0,class:"bg-base-content/30 mx-0.5 h-1.5 w-1.5 flex-none rounded-full","aria-hidden":"true"},ac=["aria-pressed","onClick"],lc=["aria-label"],hc=["aria-label","onClick"],cc=["aria-label","onClick"],fi="bg-base-300 text-base-content flex h-9 min-w-9 flex-none items-center justify-center rounded-md px-2 text-sm active:bg-primary/30",dc=fe({__name:"TerminalSymbolBar",props:{modifiers:{}},emits:["modifier","key","paste"],setup(e,{emit:t}){const i=t,s=r=>r==="locked"?"bg-primary! text-primary-content!":r==="armed"?"bg-primary/20! ring-primary ring-[1.5px] ring-inset":"";return(r,n)=>(g(),x("div",{class:"border-base-300 bg-base-200/95 flex w-full flex-none items-center gap-1.5 overflow-x-auto border-t px-2.5 py-1 backdrop-blur-lg",style:{"padding-bottom":"calc(0.25rem + env(safe-area-inset-bottom, 0px))"},role:"toolbar","aria-label":r.$t("terminalKeys")},[(g(!0),x(ie,null,ve(A(Jh),(o,a)=>(g(),x(ie,{key:a},[o.kind==="divider"?(g(),x("span",oc)):o.kind==="modifier"?(g(),x("button",{key:1,type:"button",class:Ne([fi,s(e.modifiers[o.mod])]),"aria-pressed":e.modifiers[o.mod]!=="off",onPointerdown:n[0]||(n[0]=Xt(()=>{},["prevent"])),onClick:h=>i("modifier",o.mod)},E(o.label),43,ac)):o.kind==="paste"?(g(),x("button",{key:2,type:"button",class:Ne(fi),"aria-label":r.$t("paste"),onPointerdown:n[1]||(n[1]=Xt(()=>{},["prevent"])),onClick:n[2]||(n[2]=h=>i("paste"))},[Y(A(ha),{class:"h-4 w-4"})],40,lc)):o.kind==="text"?(g(),x("button",{key:3,type:"button",class:Ne([fi,"font-mono"]),"aria-label":o.char,onPointerdown:n[3]||(n[3]=Xt(()=>{},["prevent"])),onClick:h=>i("key",o)},E(o.char),43,hc)):(g(),x("button",{key:4,type:"button",class:Ne(fi),"aria-label":o.label,onPointerdown:n[4]||(n[4]=Xt(()=>{},["prevent"])),onClick:h=>i("key",o)},E(o.label),41,cc))],64))),128))],8,nc))}}),kr='ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace',jn=13,or="Alabaster",ar="Afterglow",uc=[8,9,10,11,12,13,14,15,16,18,20,22,24,28,32],_c=["Menlo","Monaco","SF Mono","Consolas","Cascadia Code","Fira Code","JetBrains Mono","Source Code Pro","IBM Plex Mono","Roboto Mono","Ubuntu Mono","Courier New"],fc={lightThemeName:or,darkThemeName:ar,fontFamily:"",fontSize:jn},Ie=Bn("config/terminal",{...fc}),xr=e=>{const t=e.fontFamily.trim();return t?`${/\s/.test(t)?`"${t}"`:t}, ${kr}`:kr},Er=e=>e.fontSize>0?e.fontSize:jn,lr=[{name:or,isDark:!1,theme:{background:"#f7f7f7",foreground:"#000000",cursor:"#007acc",selectionBackground:"#bfdbfe",black:"#000000",red:"#aa3731",green:"#448c27",yellow:"#cb9000",blue:"#325cc0",magenta:"#7a3e9d",cyan:"#0083b2",white:"#b7b7b7",brightBlack:"#777777",brightRed:"#f05050",brightGreen:"#60cb00",brightYellow:"#f2af50",brightBlue:"#007acc",brightMagenta:"#e64ce6",brightCyan:"#00aacb",brightWhite:"#f7f7f7"}},{name:"Solarized Light",isDark:!1,theme:{background:"#fdf6e3",foreground:"#657b83",cursor:"#586e75",selectionBackground:"#eee8d5",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},{name:"Gruvbox Light",isDark:!1,theme:{background:"#fbf1c7",foreground:"#3c3836",cursor:"#3c3836",selectionBackground:"#ebdbb2",black:"#fbf1c7",red:"#cc241d",green:"#98971a",yellow:"#d79921",blue:"#458588",magenta:"#b16286",cyan:"#689d6a",white:"#7c6f64",brightBlack:"#928374",brightRed:"#9d0006",brightGreen:"#79740e",brightYellow:"#b57614",brightBlue:"#076678",brightMagenta:"#8f3f71",brightCyan:"#427b58",brightWhite:"#3c3836"}},{name:"Catppuccin Latte",isDark:!1,theme:{background:"#eff1f5",foreground:"#4c4f69",cursor:"#dc8a78",selectionBackground:"#ccd0da",black:"#5c5f77",red:"#d20f39",green:"#40a02b",yellow:"#df8e1d",blue:"#1e66f5",magenta:"#ea76cb",cyan:"#179299",white:"#acb0be",brightBlack:"#6c6f85",brightRed:"#d20f39",brightGreen:"#40a02b",brightYellow:"#df8e1d",brightBlue:"#1e66f5",brightMagenta:"#ea76cb",brightCyan:"#179299",brightWhite:"#bcc0cc"}},{name:"GitHub Light",isDark:!1,theme:{background:"#ffffff",foreground:"#24292e",cursor:"#24292e",selectionBackground:"#c8e1ff",black:"#24292e",red:"#d73a49",green:"#28a745",yellow:"#dbab09",blue:"#0366d6",magenta:"#5a32a3",cyan:"#0598bc",white:"#6a737d",brightBlack:"#959da5",brightRed:"#cb2431",brightGreen:"#22863a",brightYellow:"#b08800",brightBlue:"#005cc5",brightMagenta:"#5a32a3",brightCyan:"#3192aa",brightWhite:"#d1d5da"}},{name:ar,isDark:!0,theme:{background:"#212121",foreground:"#d0d0d0",cursor:"#d0d0d0",selectionBackground:"#303030",black:"#151515",red:"#ac4142",green:"#7e8e50",yellow:"#e5b567",blue:"#6c99bb",magenta:"#9f4e85",cyan:"#7dd6cf",white:"#d0d0d0",brightBlack:"#505050",brightRed:"#ac4142",brightGreen:"#7e8e50",brightYellow:"#e5b567",brightBlue:"#6c99bb",brightMagenta:"#9f4e85",brightCyan:"#7dd6cf",brightWhite:"#f5f5f5"}},{name:"Dracula",isDark:!0,theme:{background:"#282a36",foreground:"#f8f8f2",cursor:"#f8f8f2",selectionBackground:"#44475a",black:"#21222c",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}},{name:"Nord",isDark:!0,theme:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#434c5e",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"}},{name:"One Dark",isDark:!0,theme:{background:"#282c34",foreground:"#abb2bf",cursor:"#528bff",selectionBackground:"#3e4451",black:"#282c34",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}},{name:"Tokyo Night",isDark:!0,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}},{name:"Monokai",isDark:!0,theme:{background:"#272822",foreground:"#f8f8f2",cursor:"#f8f8f2",selectionBackground:"#49483e",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#f4bf75",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#f92672",brightGreen:"#a6e22e",brightYellow:"#f4bf75",brightBlue:"#66d9ef",brightMagenta:"#ae81ff",brightCyan:"#a1efe4",brightWhite:"#f9f8f5"}},{name:"Solarized Dark",isDark:!0,theme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",selectionBackground:"#073642",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},{name:"Gruvbox Dark",isDark:!0,theme:{background:"#282828",foreground:"#ebdbb2",cursor:"#ebdbb2",selectionBackground:"#3c3836",black:"#282828",red:"#cc241d",green:"#98971a",yellow:"#d79921",blue:"#458588",magenta:"#b16286",cyan:"#689d6a",white:"#a89984",brightBlack:"#928374",brightRed:"#fb4934",brightGreen:"#b8bb26",brightYellow:"#fabd2f",brightBlue:"#83a598",brightMagenta:"#d3869b",brightCyan:"#8ec07c",brightWhite:"#ebdbb2"}},{name:"Catppuccin Mocha",isDark:!0,theme:{background:"#1e1e2e",foreground:"#cdd6f4",cursor:"#f5e0dc",selectionBackground:"#585b70",black:"#45475a",red:"#f38ba8",green:"#a6e3a1",yellow:"#f9e2af",blue:"#89b4fa",magenta:"#f5c2e7",cyan:"#94e2d5",white:"#bac2de",brightBlack:"#585b70",brightRed:"#f38ba8",brightGreen:"#a6e3a1",brightYellow:"#f9e2af",brightBlue:"#89b4fa",brightMagenta:"#f5c2e7",brightCyan:"#94e2d5",brightWhite:"#a6adc8"}},{name:"Night Owl",isDark:!0,theme:{background:"#011627",foreground:"#d6deeb",cursor:"#80a4c2",selectionBackground:"#1d3b53",black:"#011627",red:"#ef5350",green:"#22da6e",yellow:"#c5e478",blue:"#82aaff",magenta:"#c792ea",cyan:"#21c7a8",white:"#ffffff",brightBlack:"#575656",brightRed:"#ef5350",brightGreen:"#22da6e",brightYellow:"#ffeb95",brightBlue:"#82aaff",brightMagenta:"#c792ea",brightCyan:"#7fdbca",brightWhite:"#ffffff"}}],pc=e=>{const t=e?ar:or;return lr.find(i=>i.name===t).theme},Br=e=>lr.filter(t=>t.isDark===e),gc=(e,t)=>{const i=t?e.darkThemeName:e.lightThemeName;return lr.find(s=>s.name===i)?.theme??pc(t)},vc=()=>{const e=q(0),t=()=>{const i=window.visualViewport;if(!i)return;const s=window.innerHeight-i.height-i.offsetTop;e.value=s>1?Math.round(s):0};return Ht(()=>{const i=window.visualViewport;i&&(t(),i.addEventListener("resize",t),i.addEventListener("scroll",t))}),ot(()=>{window.visualViewport?.removeEventListener("resize",t),window.visualViewport?.removeEventListener("scroll",t)}),e};var mc=2,bc=1,Sc=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,h=o.right+o.left,l=s-a,d=r-h-t;return{cols:Math.max(mc,Math.floor(d/e.css.cell.width)),rows:Math.max(bc,Math.floor(l/e.css.cell.height))}}};var Xn=Object.defineProperty,wc=Object.getOwnPropertyDescriptor,yc=(e,t)=>{for(var i in t)Xn(e,i,{get:t[i],enumerable:!0})},he=(e,t,i,s)=>{for(var r=s>1?void 0:s?wc(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Xn(t,i,r),r},$=(e,t)=>(i,s)=>t(i,s,e),Dr="Terminal input",ps={get:()=>Dr,set:e=>Dr=e},Mr="Too much output to announce, navigate to rows manually to read",gs={get:()=>Mr,set:e=>Mr=e};function Cc(e){return e.replace(/\r?\n/g,"\r")}function kc(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function xc(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function Ec(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");Gn(r,t,i,s)}}function Gn(e,t,i,s){e=Cc(e),e=kc(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Zn(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Rr(e,t,i,s,r){Zn(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function ft(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function zi(e,t=0,i=e.length){let s="";for(let r=t;r65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var Bc=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n=i)return this._interim=o,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(o-55296)*1024+a-56320+65536:(t[s++]=o,t[s++]=a);continue}o!==65279&&(t[s++]=o)}return s}},Dc=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,a,h=0,l=0;if(this.interim[0]){let u=!1,v=this.interim[0];v&=(v&224)===192?31:(v&240)===224?15:7;let _=0,m;for(;(m=this.interim[++_]&63)&&_<4;)v<<=6,v|=m;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,M=C-_;for(;l=i)return 0;if(m=e[l++],(m&192)!==128){l--,u=!0;break}else this.interim[_++]=m,v<<=6,v|=m&63}u||(C===2?v<128?l--:t[s++]=v:C===3?v<2048||v>=55296&&v<=57343||v===65279||(t[s++]=v):v<65536||v>1114111||(t[s++]=v)),this.interim.fill(0)}let d=i-4,c=l;for(;c=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(h=(r&31)<<6|n&63,h<128){c--;continue}t[s++]=h}else if((r&240)===224){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(h=(r&15)<<12|(n&63)<<6|o&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[s++]=h}else if((r&248)===240){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(a=e[c++],(a&192)!==128){c--;continue}if(h=(r&7)<<18|(n&63)<<12|(o&63)<<6|a&63,h<65536||h>1114111)continue;t[s++]=h}}return s}},Jn="",pt=" ",ai=class Qn{constructor(){this.fg=0,this.bg=0,this.extended=new Ai}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new Qn;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ai=class eo{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new eo(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ve=class to extends ai{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ai,this.combinedData=""}static fromCharData(t){let i=new to;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ft(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Lr="di$target",vs="di$dependencies",Gi=new Map;function Mc(e){return e[vs]||[]}function Ce(e){if(Gi.has(e))return Gi.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Rc(t,i,r)};return t._id=e,Gi.set(e,t),t}function Rc(e,t,i){t[Lr]===t?t[vs].push({id:e,index:i}):(t[vs]=[{id:e,index:i}],t[Lr]=t)}var Le=Ce("BufferService"),io=Ce("CoreMouseService"),Lt=Ce("CoreService"),Lc=Ce("CharsetService"),hr=Ce("InstantiationService"),so=Ce("LogService"),Pe=Ce("OptionsService"),ro=Ce("OscLinkService"),Pc=Ce("UnicodeService"),li=Ce("DecorationService"),ms=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Ve,o=i.getTrimmedLength(),a=-1,h=-1,l=!1;for(let d=0;dr?r.activate(_,m,u):Tc(_,m),hover:(_,m)=>r?.hover?.(_,m,u),leave:(_,m)=>r?.leave?.(_,m,u)})}l=!1,n.hasExtendedAttrs()&&n.extended.urlId?(h=d,a=n.extended.urlId):(h=-1,a=-1)}}t(s)}};ms=he([$(0,Le),$(1,Pe),$(2,ro)],ms);function Tc(e,t){if(confirm(`Do you want to navigate to ${t}? +import{o as g,c as x,a as p,d as fe,u as Ot,b as ot,t as E,w as Be,v as ii,e as kt,F as ie,r as ve,f as hs,g as W,h as Y,i as J,j as A,k as ue,l as j,m as Re,n as Q,p as q,q as Ne,s as Bt,x as Wo,y as Mn,z as Fi,A as Ze,B as Qs,D as $t,C as si,E as er,G as Uo,H as Rn,I as Vo,J as Ko,K as tr,L as qo,M as Ht,N as ir,O as Ci,P as sr,S as rr,Q as Xt,R as Yo,T as Ln,U as Pn,V as Tn,W as An,X as jo,Y as Xo,Z as In,_ as cs,$ as Go,a0 as ds,a1 as Zo,a2 as Jo,a3 as Qo,a4 as Yi,a5 as ui,a6 as ea,a7 as ta,a8 as ia,a9 as sa,aa as ra,ab as na,ac as oa}from"./index-BFzolhRl.js";function aa(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"})])}function wr(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"})])}function la(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.666 3.888A2.25 2.25 0 0 0 13.5 2.25h-3c-1.03 0-1.9.693-2.166 1.638m7.332 0c.055.194.084.4.084.612v0a.75.75 0 0 1-.75.75H9a.75.75 0 0 1-.75-.75v0c0-.212.03-.418.084-.612m7.332 0c.646.049 1.288.11 1.927.184 1.1.128 1.907 1.077 1.907 2.185V19.5a2.25 2.25 0 0 1-2.25 2.25H6.75A2.25 2.25 0 0 1 4.5 19.5V6.257c0-1.108.806-2.057 1.907-2.185a48.208 48.208 0 0 1 1.927-.184"})])}function Nn(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})])}function On(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"})])}function ha(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}function ca(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"})])}function da(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.217 10.907a2.25 2.25 0 1 0 0 2.186m0-2.186c.18.324.283.696.283 1.093s-.103.77-.283 1.093m0-2.186 9.566-5.314m-9.566 7.5 9.566 5.314m0 0a2.25 2.25 0 1 0 3.935 2.186 2.25 2.25 0 0 0-3.935-2.186Zm0-12.814a2.25 2.25 0 1 0 3.933-2.185 2.25 2.25 0 0 0-3.933 2.185Z"})])}function ua(e,t){return g(),x("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[p("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 7.5A2.25 2.25 0 0 1 7.5 5.25h9a2.25 2.25 0 0 1 2.25 2.25v9a2.25 2.25 0 0 1-2.25 2.25h-9a2.25 2.25 0 0 1-2.25-2.25v-9Z"})])}const _a={class:"p-2 sm:p-4"},fa={class:"mx-auto grid w-full max-w-5xl grid-cols-1 items-start gap-x-6 lg:grid-cols-2"},pa={class:"flex flex-col gap-1"},ga={class:"settings-section-label"},va={class:"settings-grid"},ma={class:"setting-item"},ba={class:"setting-item-label"},Sa=["disabled"],wa={class:"setting-item"},ya={class:"setting-item-label"},Ca=["disabled"],ka={value:""},xa=["value"],Ea={class:"setting-item"},Ba={class:"setting-item-label"},Da=["disabled"],Ma=["value"],Ra={class:"setting-item"},La={class:"setting-item-label"},Pa=["disabled"],Ta={class:"setting-item"},Aa={class:"setting-item-label"},Ia=["disabled"],Na={class:"setting-item"},Oa={key:0,class:"text-error px-1 pt-2 text-sm"},$a={key:1,class:"settings-grid mt-2"},Ha={key:2,class:"flex items-center gap-2 px-1 pt-2 text-sm opacity-70"},Fa={class:"flex flex-col gap-1"},za={class:"settings-section-label"},Wa={class:"settings-grid"},Ua={class:"setting-item"},Va={class:"setting-item-label"},Ka=["disabled"],qa={class:"setting-item"},Ya={class:"setting-item-label"},ja=["disabled"],Xa={value:""},Ga=["value"],Za={class:"setting-item"},Ja={key:0,class:"text-error px-1 pt-2 text-sm"},Qa={key:1,class:"settings-grid mt-2"},el={key:1,class:"loading loading-spinner loading-xs"},tl={key:2},il={key:1,class:"loading loading-spinner loading-xs"},sl={key:2},rl={key:2,class:"flex items-center gap-2 px-1 pt-2 text-sm opacity-70"},nl="https://mensura.cdn-apple.com/api/v1/gm/config",ol="stun.voipgate.com:3478",al=fe({__name:"NetworkToolsPanel",setup(e){const{t}=Ot(),i=fe({props:{label:String},setup:(w,{slots:S})=>()=>Re("div",{class:"setting-item"},[Re("div",{class:"setting-item-label"},w.label),Re("span",{class:"text-right font-medium break-all"},S.default?.())])}),s=fe({props:{pending:Boolean,value:String},setup:(w,{slots:S})=>()=>Re("span",{class:"inline-flex items-center gap-2"},[w.pending?Re("span",{class:"loading loading-spinner loading-xs"}):null,w.value,S.default?.()])}),r=fe({props:{accuracy:{type:Number,required:!0}},setup:w=>()=>{const S={2:["accuracyHigh","badge-success"],1:["accuracyMedium","badge-warning"]},[z,Z]=S[w.accuracy]??["accuracyLow","badge-error"];return Re("span",{class:`badge badge-xs ${Z}`},t(z))}}),n=()=>Bt(),o=Q(()=>Object.keys(Wo.value)),a=w=>{const S=Number(w);return S>=1e9?`${(S/1e9).toFixed(1)} Gbps`:S>=1e6?`${(S/1e6).toFixed(1)} Mbps`:S>=1e3?`${(S/1e3).toFixed(1)} kbps`:`${Math.round(S)} bps`},h=w=>({good:"badge-success",medium:"badge-warning",bad:"badge-error",neutral:"badge-ghost"})[w],l=w=>({2:"Endpoint Independent",3:"Address Dependent",4:"Address and Port Dependent"})[w]??"Unknown",d=w=>({1:"Endpoint Independent",2:"Address Dependent",3:"Address and Port Dependent"})[w]??"Unknown",c=w=>({2:"good",3:"medium",4:"bad"})[w]??"neutral",u=w=>({1:"good",2:"medium",3:"bad"})[w]??"neutral",v=q(nl),_=q(""),m=q(!1),C=q(!1),M=q(20),H=q(!1),I=q(""),f=q(),L=Q(()=>f.value?.isFinal??!1);let B=null;const U=async()=>{const w=n();if(w){H.value=!0,I.value="",f.value=void 0,B=new AbortController;try{for await(const S of w.client.startNetworkQualityTest({configURL:v.value,outboundTag:_.value,http3:C.value,maxRuntimeSeconds:M.value,serial:m.value},{signal:B.signal}))if(f.value=S,S.error&&(I.value=S.error),S.isFinal)break}catch(S){B.signal.aborted||(I.value=String(S))}finally{H.value=!1}}},V=()=>{B?.abort(),H.value=!1},F=q(ol),R=q(""),N=q(!1),k=q(""),b=q();let P=null;const O=async()=>{const w=n();if(w){N.value=!0,k.value="",b.value=void 0,P=new AbortController;try{for await(const S of w.client.startSTUNTest({server:F.value,outboundTag:R.value},{signal:P.signal}))if(b.value=S,S.error&&(k.value=S.error),S.isFinal)break}catch(S){P.signal.aborted||(k.value=String(S))}finally{N.value=!1}}},D=()=>{P?.abort(),N.value=!1};return ot(()=>{B?.abort(),P?.abort()}),(w,S)=>(g(),x("div",_a,[p("div",fa,[p("section",pa,[p("div",ga,E(w.$t("networkQuality")),1),p("div",va,[p("div",ma,[p("div",ba,E(w.$t("configURL")),1),Be(p("input",{class:"input input-sm w-48 max-w-full sm:w-80","onUpdate:modelValue":S[0]||(S[0]=z=>v.value=z),disabled:H.value},null,8,Sa),[[ii,v.value]])]),p("div",wa,[p("div",ya,E(w.$t("outbound")),1),Be(p("select",{class:"select select-sm min-w-24","onUpdate:modelValue":S[1]||(S[1]=z=>_.value=z),disabled:H.value},[p("option",ka,E(w.$t("default")),1),(g(!0),x(ie,null,ve(o.value,z=>(g(),x("option",{key:z,value:z},E(z),9,xa))),128))],8,Ca),[[kt,_.value]])]),p("div",Ea,[p("div",Ba,E(w.$t("maxRuntime")),1),Be(p("select",{class:"select select-sm min-w-24","onUpdate:modelValue":S[2]||(S[2]=z=>M.value=z),disabled:H.value},[(g(),x(ie,null,ve([20,30,60],z=>p("option",{key:z,value:z},E(z)+" s ",9,Ma)),64))],8,Da),[[kt,M.value,void 0,{number:!0}]])]),p("div",Ra,[p("div",La,E(w.$t("serial")),1),Be(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":S[3]||(S[3]=z=>m.value=z),disabled:H.value},null,8,Pa),[[hs,m.value]])]),p("div",Ta,[p("div",Aa,E(w.$t("http3")),1),Be(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":S[4]||(S[4]=z=>C.value=z),disabled:H.value},null,8,Ia),[[hs,C.value]])]),p("div",Na,[H.value?(g(),x("button",{key:1,class:"btn btn-sm ml-auto",onClick:V},E(w.$t("cancelTest")),1)):(g(),x("button",{key:0,class:"btn btn-neutral btn-sm ml-auto",onClick:U},E(w.$t("startTest")),1))])]),I.value?(g(),x("div",Oa,E(I.value),1)):W("",!0),f.value?(g(),x("div",$a,[Y(A(i),{label:w.$t("idleLatency")},{default:J(()=>[ue(E(f.value.idleLatencyMs>0?`${f.value.idleLatencyMs} ms`:"-"),1)]),_:1},8,["label"]),Y(A(i),{label:w.$t("download")},{default:J(()=>[Y(A(s),{pending:H.value&&!L.value&&f.value.phase===1,value:f.value.downloadCapacity>0n?a(f.value.downloadCapacity):"-"},{default:J(()=>[L.value&&f.value.downloadCapacity>0n?(g(),j(A(r),{key:0,accuracy:f.value.downloadCapacityAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("upload")},{default:J(()=>[Y(A(s),{pending:H.value&&!L.value&&f.value.phase===2,value:f.value.uploadCapacity>0n?a(f.value.uploadCapacity):"-"},{default:J(()=>[L.value&&f.value.uploadCapacity>0n?(g(),j(A(r),{key:0,accuracy:f.value.uploadCapacityAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("downloadRPM")},{default:J(()=>[Y(A(s),{pending:H.value&&!L.value&&f.value.phase===1,value:f.value.downloadRPM>0?String(f.value.downloadRPM):"-"},{default:J(()=>[L.value&&f.value.downloadRPM>0?(g(),j(A(r),{key:0,accuracy:f.value.downloadRPMAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("uploadRPM")},{default:J(()=>[Y(A(s),{pending:H.value&&!L.value&&f.value.phase===2,value:f.value.uploadRPM>0?String(f.value.uploadRPM):"-"},{default:J(()=>[L.value&&f.value.uploadRPM>0?(g(),j(A(r),{key:0,accuracy:f.value.uploadRPMAccuracy},null,8,["accuracy"])):W("",!0)]),_:1},8,["pending","value"])]),_:1},8,["label"]),Y(A(i),{label:w.$t("elapsed")},{default:J(()=>[ue(E(`${(Number(f.value.elapsedMs)/1e3).toFixed(1)} s`),1)]),_:1},8,["label"])])):H.value?(g(),x("div",Ha,[S[7]||(S[7]=p("span",{class:"loading loading-spinner loading-xs"},null,-1)),ue(" "+E(w.$t("fetchingConfiguration")),1)])):W("",!0)]),p("section",Fa,[p("div",za,E(w.$t("stunTest"))+" - "+E(w.$t("natTypeDetection")),1),p("div",Wa,[p("div",Ua,[p("div",Va,E(w.$t("serverField")),1),Be(p("input",{class:"input input-sm w-48 max-w-full sm:w-72","onUpdate:modelValue":S[5]||(S[5]=z=>F.value=z),disabled:N.value},null,8,Ka),[[ii,F.value]])]),p("div",qa,[p("div",Ya,E(w.$t("outbound")),1),Be(p("select",{class:"select select-sm min-w-24","onUpdate:modelValue":S[6]||(S[6]=z=>R.value=z),disabled:N.value},[p("option",Xa,E(w.$t("default")),1),(g(!0),x(ie,null,ve(o.value,z=>(g(),x("option",{key:z,value:z},E(z),9,Ga))),128))],8,ja),[[kt,R.value]])]),p("div",Za,[N.value?(g(),x("button",{key:1,class:"btn btn-sm ml-auto",onClick:D},E(w.$t("cancelTest")),1)):(g(),x("button",{key:0,class:"btn btn-neutral btn-sm ml-auto",onClick:O},E(w.$t("startTest")),1))])]),k.value?(g(),x("div",Ja,E(k.value),1)):W("",!0),b.value?(g(),x("div",Qa,[Y(A(i),{label:w.$t("externalAddress")},{default:J(()=>[ue(E(b.value.externalAddr||"-"),1)]),_:1},8,["label"]),Y(A(i),{label:w.$t("latency")},{default:J(()=>[ue(E(b.value.latencyMs>0?`${b.value.latencyMs} ms`:"-"),1)]),_:1},8,["label"]),b.value.isFinal&&!b.value.natTypeSupported?(g(),j(A(i),{key:0,label:w.$t("natTypeDetection")},{default:J(()=>[ue(E(w.$t("notSupportedByServer")),1)]),_:1},8,["label"])):(g(),x(ie,{key:1},[Y(A(i),{label:w.$t("natMapping")},{default:J(()=>[b.value.natMapping>0?(g(),x("span",{key:0,class:Ne(["badge badge-sm",h(c(b.value.natMapping))])},E(l(b.value.natMapping)),3)):N.value?(g(),x("span",el)):(g(),x("span",tl,"-"))]),_:1},8,["label"]),Y(A(i),{label:w.$t("natFiltering")},{default:J(()=>[b.value.natFiltering>0?(g(),x("span",{key:0,class:Ne(["badge badge-sm",h(u(b.value.natFiltering))])},E(d(b.value.natFiltering)),3)):N.value?(g(),x("span",il)):(g(),x("span",sl,"-"))]),_:1},8,["label"])],64))])):N.value?(g(),x("div",rl,[S[8]||(S[8]=p("span",{class:"loading loading-spinner loading-xs"},null,-1)),ue(" "+E(w.$t("binding")),1)])):W("",!0)])])]))}});var Ct=(e=>(e[e.Border=-1]="Border",e[e.Data=0]="Data",e[e.Function=1]="Function",e[e.Position=2]="Position",e[e.Timing=3]="Timing",e[e.Alignment=4]="Alignment",e))(Ct||{});const ll=[0,1],$n=[1,0],Hn=[2,3],Fn=[3,2],hl={L:ll,M:$n,Q:Hn,H:Fn},cl=/^\d*$/,dl=/^[A-Z0-9 $%*+./:-]*$/,ji="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",nr=1,or=40,yr=3,ul=3,_i=40,_l=10,zn=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],Wn=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]];class fl{constructor(t,i,s,r){if(this.version=t,this.ecc=i,tor)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=t*4+17;const n=Array.from({length:this.size}).fill(!1);for(let a=0;a0));this.drawFunctionPatterns();const o=this.addEccAndInterleave(s);if(this.drawCodewords(o),r===-1){let a=1e9;for(let h=0;h<8;h++){this.applyMask(h),this.drawFormatBits(h);const l=this.getPenaltyScore();l=0&&t=0&&i>>9)*1335;const r=(i<<10|s)^21522;for(let n=0;n<=5;n++)this.setFunctionModule(8,n,et(r,n));this.setFunctionModule(8,7,et(r,6)),this.setFunctionModule(8,8,et(r,7)),this.setFunctionModule(7,8,et(r,8));for(let n=9;n<15;n++)this.setFunctionModule(14-n,8,et(r,n));for(let n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,et(r,n));for(let n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,et(r,n));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let t=this.version;for(let s=0;s<12;s++)t=t<<1^(t>>>11)*7973;const i=this.version<<12|t;for(let s=0;s<18;s++){const r=et(i,s),n=this.size-11+s%3,o=Math.floor(s/3);this.setFunctionModule(n,o,r),this.setFunctionModule(o,n,r)}}drawFinderPattern(t,i){for(let s=-4;s<=4;s++)for(let r=-4;r<=4;r++){const n=Math.max(Math.abs(r),Math.abs(s)),o=t+r,a=i+s;o>=0&&o=0&&a{(u!==h-n||_>=a)&&c.push(v[u])});return c}drawCodewords(t){if(t.length!==Math.floor(us(this.version)/8))throw new RangeError("Invalid argument");let i=0;for(let s=this.size-1;s>=1;s-=2){s===6&&(s=5);for(let r=0;r>>3],7-(i&7)),i++)}}}applyMask(t){if(t<0||t>7)throw new RangeError("Mask value out of range");for(let i=0;i5&&t++):(this.finderPenaltyAddHistory(a,h),o||(t+=this.finderPenaltyCountPatterns(h)*_i),o=this.modules[n][l],a=1);t+=this.finderPenaltyTerminateAndCount(o,a,h)*_i}for(let n=0;n5&&t++):(this.finderPenaltyAddHistory(a,h),o||(t+=this.finderPenaltyCountPatterns(h)*_i),o=this.modules[l][n],a=1);t+=this.finderPenaltyTerminateAndCount(o,a,h)*_i}for(let n=0;no+(a?1:0),i);const s=this.size*this.size,r=Math.ceil(Math.abs(i*20-s*10)/s)-1;return t+=r*_l,t}getAlignmentPatternPositions(){if(this.version===1)return[];{const t=Math.floor(this.version/7)+2,i=this.version===32?26:Math.ceil((this.version*4+4)/(t*2-2))*2,s=[6];for(let r=this.size-7;s.length0&&t[2]===i&&t[3]===i*3&&t[4]===i&&t[5]===i;return(s&&t[0]>=i*4&&t[6]>=i?1:0)+(s&&t[6]>=i*4&&t[0]>=i?1:0)}finderPenaltyTerminateAndCount(t,i,s){return t&&(this.finderPenaltyAddHistory(i,s),i=0),i+=this.size,this.finderPenaltyAddHistory(i,s),this.finderPenaltyCountPatterns(s)}finderPenaltyAddHistory(t,i){i[0]===0&&(t+=this.size),i.pop(),i.unshift(t)}}function st(e,t,i){if(t<0||t>31||e>>>t)throw new RangeError("Value out of range");for(let s=t-1;s>=0;s--)i.push(e>>>s&1)}function et(e,t){return(e>>>t&1)!==0}class ar{constructor(t,i,s){if(this.mode=t,this.numChars=i,this.bitData=s,i<0)throw new RangeError("Invalid argument");this.bitData=s.slice()}getData(){return this.bitData.slice()}}const pl=[1,10,12,14],gl=[2,9,11,13],vl=[4,8,16,16];function Un(e,t){return e[Math.floor((t+7)/17)+1]}function Vn(e){const t=[];for(const i of e)st(i,8,t);return new ar(vl,e.length,t)}function ml(e){if(!Kn(e))throw new RangeError("String contains non-numeric characters");const t=[];for(let i=0;i=1<or)throw new RangeError("Version number out of range");let t=(16*e+128)*e+64;if(e>=2){const i=Math.floor(e/7)+2;t-=(25*i-10)*i-55,e>=7&&(t-=36)}return t}function ki(e,t){return Math.floor(us(e)/8)-zn[t[0]][e]*Wn[t[0]][e]}function Cl(e){if(e<1||e>255)throw new RangeError("Degree out of range");const t=[];for(let s=0;s0);for(const s of e){const r=s^i.shift();i.push(0),t.forEach((n,o)=>i[o]^=_s(n,r))}return i}function _s(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");let i=0;for(let s=7;s>=0;s--)i=i<<1^(i>>>7)*285,i^=(t>>>s&1)*e;return i}function xl(e,t,i=1,s=40,r=-1,n=!0){if(!(nr<=i&&i<=s&&s<=or)||r<-1||r>7)throw new RangeError("Invalid value");let o,a;for(o=i;;o++){const c=ki(o,t)*8,u=wl(e,o);if(u<=c){a=u;break}if(o>=s)throw new RangeError("Data too long")}for(const c of[$n,Hn,Fn])n&&a<=ki(o,c)*8&&(t=c);const h=[];for(const c of e){st(c.mode[0],4,h),st(c.numChars,Un(c.mode,o),h);for(const u of c.getData())h.push(u)}const l=ki(o,t)*8;st(0,Math.min(4,l-h.length),h),st(0,(8-h.length%8)%8,h);for(let c=236;h.length0);return h.forEach((c,u)=>d[u>>>3]|=c<<7-(u&7)),new fl(o,t,d,r)}function El(e,t){const{ecc:i="L",boostEcc:s=!1,minVersion:r=1,maxVersion:n=40,maskPattern:o=-1,border:a=1}=t||{},h=typeof e=="string"?Sl(e):Array.isArray(e)?[Vn(e)]:void 0;if(!h)throw new Error(`uqr only supports encoding string and binary data, but got: ${typeof e}`);const l=xl(h,hl[i],r,n,o,s),d=Bl({version:l.version,maskPattern:l.mask,size:l.size,data:l.modules,types:l.types},a);return t?.invert&&(d.data=d.data.map(c=>c.map(u=>!u))),t?.onEncoded?.(d),d}function Bl(e,t=1){if(!t)return e;const{size:i}=e,s=i+t*2;e.size=s,e.data.forEach(n=>{for(let o=0;o!1)),e.data.push(Array.from({length:s},o=>!1));const r=Ct.Border;e.types.forEach(n=>{for(let o=0;or)),e.types.push(Array.from({length:s},o=>r));return e}const Dl=["viewBox","aria-label"],Ml=["d"],Rl=fe({__name:"QRCodeView",props:{value:{}},setup(e){const t=e,i=Q(()=>El(t.value,{border:2})),s=Q(()=>{const r=[];return i.value.data.forEach((n,o)=>n.forEach((a,h)=>{a&&r.push(`M${h} ${o}h1v1h-1z`)})),r.join("")});return(r,n)=>(g(),x("svg",{class:"h-auto w-full max-w-64 rounded bg-white p-3",viewBox:`0 0 ${i.value.size} ${i.value.size}`,role:"img","aria-label":e.value},[p("path",{d:s.value,fill:"#000","shape-rendering":"crispEdges"},null,8,Ml)],8,Dl))}}),fs="root",xi="xterm-256color",Dt=Mn("config/tailscale-ssh",{}),Ll=(e,t)=>{Dt.value={...Dt.value,[e]:t}},Cr=e=>e?.userGroups.flatMap(t=>t.peers)??[],nt=e=>e?e.dnsName!==""?e.dnsName.split(".")[0]:e.hostName||e.tailscaleIPs[0]||e.stableID:"",Yn=e=>e.tailscaleIPs.find(t=>!t.includes(":"))??e.tailscaleIPs[0]??e.dnsName,jn=e=>e.online&&e.sshHostKeys.length>0&&e.tailscaleIPs.length>0,Xn=(e,t,i,s)=>({endpointTag:e,peerAddress:Yn(t),peerName:nt(t),username:i,terminalType:s,hostKeys:t.sshHostKeys}),Pl={class:"flex flex-col gap-3"},Tl=["placeholder"],Al={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},Il={class:"setting-item-label"},Nl=["onClick"],Ol={class:"setting-item-label flex min-w-0 items-center gap-2"},$l={class:"truncate text-sm font-medium"},Hl={class:"text-base-content/40 truncate text-xs"},Fl=fe({__name:"TailscaleExitNodeDialog",props:si({endpoint:{},candidates:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,i=Fi(e,"modelValue"),s=er("searchEl"),r=q(""),n=Q(()=>t.endpoint.exitNode?.stableID??""),o=Q(()=>{const h=r.value.trim().toLowerCase();return h===""?t.candidates:t.candidates.filter(l=>nt(l).toLowerCase().includes(h)||l.hostName.toLowerCase().includes(h)||l.dnsName.toLowerCase().includes(h)||l.tailscaleIPs.some(d=>d.includes(h)))});Ze(i,async h=>{h&&(r.value="",await Qs(),s.value?.focus())});const a=h=>{Bt()?.client.setTailscaleExitNode({endpointTag:t.endpoint.endpointTag,stableID:h}),i.value=!1};return(h,l)=>(g(),j($t,{modelValue:i.value,"onUpdate:modelValue":l[2]||(l[2]=d=>i.value=d),title:h.$t("exitNode")},{default:J(()=>[p("div",Pl,[Be(p("input",{ref_key:"searchEl",ref:s,class:"input input-sm w-full rounded-lg",placeholder:h.$t("search"),"onUpdate:modelValue":l[0]||(l[0]=d=>r.value=d)},null,8,Tl),[[ii,r.value]]),p("div",Al,[p("button",{class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:l[1]||(l[1]=d=>a(""))},[p("span",Il,E(h.$t("disabledLabel")),1),n.value===""?(g(),j(A(wr),{key:0,class:"text-primary h-4 w-4 shrink-0"})):W("",!0)]),(g(!0),x(ie,null,ve(o.value,d=>(g(),x("button",{key:d.stableID,class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:c=>a(d.stableID)},[p("span",{class:Ne(["inline-block h-2 w-2 shrink-0 rounded-full",d.online?"bg-success":"bg-base-content/20"])},null,2),p("span",Ol,[p("span",$l,E(A(nt)(d)),1),p("span",Hl,E(d.tailscaleIPs[0]),1)]),n.value===d.stableID?(g(),j(A(wr),{key:0,class:"text-primary h-4 w-4 shrink-0"})):W("",!0)],8,Nl))),128))])])]),_:1},8,["modelValue","title"]))}}),zl=["height","viewBox"],Wl=["points","fill"],Ul=["points","stroke"],kr=300,Vl=fe({__name:"PingSparkline",props:{data:{},height:{default:56},color:{default:"currentColor"},capacity:{default:30}},setup(e){const t=e,i=Q(()=>{const n=Math.max(...t.data,1),o=kr/Math.max(t.capacity-1,1),a=Math.max(0,t.capacity-t.data.length);return t.data.map((h,l)=>{const d=(a+l)*o,c=t.height-3-h/(n*1.2)*(t.height-6);return`${d.toFixed(1)},${c.toFixed(1)}`})}),s=Q(()=>i.value.join(" ")),r=Q(()=>{const n=i.value,o=n[0].split(",")[0],a=n[n.length-1].split(",")[0];return`${o},${t.height} ${n.join(" ")} ${a},${t.height}`});return(n,o)=>(g(),x("svg",{width:"100%",height:e.height,viewBox:`0 0 ${kr} ${e.height}`,preserveAspectRatio:"none",class:"block"},[i.value.length>1?(g(),x(ie,{key:0},[p("polygon",{points:r.value,fill:e.color,opacity:"0.1"},null,8,Wl),p("polyline",{points:s.value,fill:"none",stroke:e.color,"stroke-width":"1.8","stroke-linejoin":"round","stroke-linecap":"round","vector-effect":"non-scaling-stroke"},null,8,Ul)],64)):W("",!0)],8,zl))}}),Kl={class:"flex flex-col gap-4 text-sm"},ql={class:"flex flex-col gap-1"},Yl={class:"text-base-content/45 px-1 text-xs font-medium"},jl={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},Xl={key:0,class:"flex flex-col gap-1"},Gl={class:"flex items-center justify-between"},Zl={class:"text-base-content/45 px-1 text-xs font-medium"},Jl={key:0,class:"text-error py-1"},Ql={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},eh={key:2,class:"py-1 opacity-60"},th={key:3,class:"py-1 opacity-60"},ih={class:"flex flex-col gap-1"},sh={class:"text-base-content/45 px-1 text-xs font-medium"},rh={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},nh={key:1,class:"flex justify-end gap-2 pt-1"},oh=fe({__name:"TailscalePeerDialog",props:si({endpoint:{},peer:{},isSelf:{type:Boolean}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:si(["connectSsh","editSsh"],["update:modelValue"]),setup(e,{emit:t}){const i=e,s=Fi(e,"modelValue"),r=t,{t:n}=Ot(),{copy:o}=Uo(),a=fe({props:{label:String},setup:(F,{slots:R})=>()=>Re("div",{class:"flex min-h-11 items-center justify-between gap-3 px-4 py-2"},[Re("span",{class:"text-base-content/55"},F.label),Re("span",{class:"text-right break-all"},R.default?.())])}),h=F=>{F&&(o(F),tr({content:"copySuccess",type:"alert-success",timeout:2e3}))},l=fe({props:{label:String,value:String},setup:F=>()=>Re("div",{class:"flex min-h-11 items-center justify-between gap-3 px-4 py-2"},[Re("span",{class:"text-base-content/55"},F.label),Re("div",{class:"flex items-center gap-2"},[Re("span",{class:"text-right break-all"},F.value),Re("button",{class:"btn btn-ghost btn-xs btn-circle shrink-0",onClick:()=>h(F.value),title:n("copy"),"aria-label":n("copy")},Re(On,{class:"h-4 w-4"}))])])}),d=Q(()=>i.peer.dnsName.replace(/\.$/,"")),c=Q(()=>i.peer.tailscaleIPs.find(F=>!F.includes(":"))),u=Q(()=>i.peer.tailscaleIPs.find(F=>F.includes(":"))),v=F=>Ko(Number(F)*1e3).fromNow(),_=Q(()=>i.peer.expired?n("expired"):i.peer.keyExpiry>0n?v(i.peer.keyExpiry):n("disabledLabel")),m=Q(()=>!i.isSelf&&i.peer.online&&i.peer.sshHostKeys.length>0),C=Q(()=>Dt.value[i.peer.stableID]?.remember??!1),M=q(!1),H=q(""),I=q(),f=q([]);let L=null;const B=async()=>{const F=Bt();if(F){M.value=!0,H.value="",I.value=void 0,f.value=[],L=new AbortController;try{for await(const R of F.client.startTailscalePing({endpointTag:i.endpoint.endpointTag,peerIP:i.peer.tailscaleIPs[0]??""},{signal:L.signal})){if(R.error){H.value=R.error;continue}I.value=R;const N=f.value.concat(R.latencyMs);f.value=N.length>30?N.slice(N.length-30):N}}catch(R){L.signal.aborted||(H.value=String(R))}finally{M.value=!1}}},U=()=>{L?.abort(),M.value=!1},V=()=>{U(),H.value="",I.value=void 0,f.value=[]};return Ze(s,F=>{F||V()}),Ze(()=>i.peer.stableID,()=>V()),ot(U),(F,R)=>(g(),j($t,{modelValue:s.value,"onUpdate:modelValue":R[3]||(R[3]=N=>s.value=N),title:A(nt)(e.peer)},{"title-right":J(()=>[p("span",{class:Ne(["ml-2 rounded-full px-2 py-0.5 text-[0.65rem] font-medium",e.peer.online?"bg-success/15 text-success":"bg-base-content/10 text-base-content/60"])},E(e.peer.online?F.$t("connected"):F.$t("notConnected")),3)]),default:J(()=>[p("div",Kl,[p("section",ql,[p("div",Yl,E(F.$t("addresses")),1),p("div",jl,[d.value?(g(),j(A(l),{key:0,label:"MagicDNS",value:d.value},null,8,["value"])):W("",!0),Y(A(l),{label:F.$t("hostnameLabel"),value:e.peer.hostName},null,8,["label","value"]),c.value?(g(),j(A(l),{key:1,label:"IPv4",value:c.value},null,8,["value"])):W("",!0),u.value?(g(),j(A(l),{key:2,label:"IPv6",value:u.value},null,8,["value"])):W("",!0)])]),!e.isSelf&&e.peer.online?(g(),x("section",Xl,[p("div",Gl,[p("span",Zl,E(F.$t("ping")),1),p("button",{class:"btn btn-ghost btn-xs",onClick:R[0]||(R[0]=N=>M.value?U():B())},[(g(),j(Rn(M.value?A(ua):A(Vo)),{class:"h-4 w-4"}))])]),H.value?(g(),x("div",Jl,E(H.value),1)):W("",!0),I.value?(g(),x(ie,{key:1},[p("div",Ql,[Y(A(a),{label:I.value.isDirect?F.$t("directConnection"):F.$t("derpRelayed")},{default:J(()=>[ue(E(I.value.latencyMs.toFixed(1))+" ms ",1)]),_:1},8,["label"]),!I.value.isDirect&&I.value.derpRegionCode?(g(),j(A(a),{key:0,label:F.$t("derpRegion")},{default:J(()=>[ue(E(I.value.derpRegionCode),1)]),_:1},8,["label"])):W("",!0),I.value.isDirect&&I.value.endpoint?(g(),j(A(a),{key:1,label:F.$t("endpointLabel")},{default:J(()=>[ue(E(I.value.endpoint),1)]),_:1},8,["label"])):W("",!0)]),Y(Vl,{data:f.value,color:I.value.isDirect?"var(--color-success)":"var(--color-info)",class:"text-primary mt-1"},null,8,["data","color"])],64)):M.value?(g(),x("div",eh,E(F.$t("connecting")),1)):(g(),x("div",th,E(F.$t("noData")),1))])):W("",!0),p("section",ih,[p("div",sh,E(F.$t("detailsLabel")),1),p("div",rh,[e.peer.os?(g(),j(A(a),{key:0,label:F.$t("osLabel")},{default:J(()=>[ue(E(e.peer.os),1)]),_:1},8,["label"])):W("",!0),Y(A(a),{label:F.$t("keyExpiry")},{default:J(()=>[ue(E(_.value),1)]),_:1},8,["label"]),!e.peer.online&&e.peer.lastSeen>0n?(g(),j(A(a),{key:1,label:F.$t("lastSeen")},{default:J(()=>[ue(E(v(e.peer.lastSeen)),1)]),_:1},8,["label"])):W("",!0),e.peer.exitNodeOption?(g(),j(A(a),{key:2,label:F.$t("exitNode")},{default:J(()=>[ue(E(e.peer.exitNode?F.$t("activeLabel"):F.$t("availableLabel")),1)]),_:1},8,["label"])):W("",!0),e.peer.shareeNode?(g(),j(A(a),{key:3,label:F.$t("sharedIn")},{default:J(()=>[ue(E(F.$t("yes")),1)]),_:1},8,["label"])):W("",!0)])]),m.value?(g(),x("div",nh,[C.value?(g(),x("button",{key:0,class:"btn btn-sm rounded-lg",onClick:R[1]||(R[1]=N=>r("editSsh"))},E(F.$t("editSSHConfiguration")),1)):W("",!0),p("button",{class:"btn btn-primary btn-sm rounded-lg",onClick:R[2]||(R[2]=N=>r("connectSsh"))},[Y(A(Nn),{class:"h-4 w-4"}),ue(" "+E(F.$t("connectViaSSH")),1)])])):W("",!0)])]),_:1},8,["modelValue","title"]))}}),ah={class:"flex flex-col gap-3"},lh={class:"text-base-content/55 px-1 text-sm"},hh={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},ch={class:"setting-item"},dh={class:"setting-item-label"},uh={class:"setting-item"},_h={class:"setting-item-label"},fh={class:"setting-item cursor-pointer"},ph={class:"setting-item-label"},gh={class:"flex justify-end gap-2 pt-1"},vh=["disabled"],mh=fe({__name:"TailscaleSSHDialog",props:si({peer:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:si(["connect"],["update:modelValue"]),setup(e,{emit:t}){const i=e,s=Fi(e,"modelValue"),r=t,n=er("usernameEl"),o=q(fs),a=q(xi),h=q(!1);Ze(s,async d=>{if(!d)return;const c=Dt.value[i.peer.stableID];o.value=c?.username??fs,a.value=c?.terminalType??xi,h.value=c?.remember??!1,await Qs(),n.value?.focus()});const l=()=>{const d=o.value.trim();d!==""&&(r("connect",d,a.value.trim()||xi,h.value),s.value=!1)};return(d,c)=>(g(),j($t,{modelValue:s.value,"onUpdate:modelValue":c[4]||(c[4]=u=>s.value=u),title:d.$t("sshConfiguration")},{default:J(()=>[p("div",ah,[p("div",lh,E(A(nt)(e.peer)),1),p("div",hh,[p("div",ch,[p("span",dh,E(d.$t("username")),1),Be(p("input",{ref_key:"usernameEl",ref:n,class:"input input-ghost input-sm w-40 text-right","onUpdate:modelValue":c[0]||(c[0]=u=>o.value=u),onKeydown:qo(l,["enter"])},null,544),[[ii,o.value]])]),p("div",uh,[p("span",_h,E(d.$t("terminalType")),1),Be(p("input",{class:"input input-ghost input-sm w-40 text-right","onUpdate:modelValue":c[1]||(c[1]=u=>a.value=u)},null,512),[[ii,a.value]])]),p("label",fh,[p("span",ph,E(d.$t("rememberSSHOptions")),1),Be(p("input",{type:"checkbox",class:"toggle","onUpdate:modelValue":c[2]||(c[2]=u=>h.value=u)},null,512),[[hs,h.value]])])]),p("div",gh,[p("button",{class:"btn btn-sm rounded-lg",onClick:c[3]||(c[3]=u=>s.value=!1)},E(d.$t("cancel")),1),p("button",{class:"btn btn-primary btn-sm rounded-lg",disabled:o.value.trim()==="",onClick:l},E(d.$t("connect")),9,vh)])])]),_:1},8,["modelValue","title"]))}}),bh={class:"mx-auto flex max-w-2xl flex-col p-2 sm:p-4"},Sh={key:0,class:"text-base-content/50 p-12 text-center text-sm"},wh={class:"settings-section-label flex items-center justify-between gap-2 normal-case"},yh={class:"flex items-center gap-2 tracking-normal"},Ch={class:"text-base-content/90 text-sm font-semibold"},kh=["onClick"],xh={class:"settings-grid"},Eh=["onClick"],Bh={class:"setting-item-label"},Dh={class:"text-base-content/50 truncate text-sm"},Mh=["onClick"],Rh={class:"setting-item-label"},Lh={class:"text-base-content/50 truncate text-sm"},Ph={key:2,class:"setting-item"},Th={class:"setting-item-label"},Ah={class:"text-base-content/50 truncate text-sm"},Ih={key:3,class:"setting-item"},Nh={class:"setting-item-label shrink-0"},Oh=["href"],$h=["title","onClick"],Hh={class:"settings-section-label"},Fh={class:"settings-grid"},zh=["onClick"],Wh={class:"truncate text-sm font-medium"},Uh={class:"text-base-content/40 truncate text-xs"},Vh={key:1,class:"bg-base-content/8 text-base-content/60 shrink-0 rounded-full px-2 py-0.5 text-[0.65rem] font-medium"},Kh={key:2,class:"bg-error/15 text-error shrink-0 rounded-full px-2 py-0.5 text-[0.65rem] font-medium"},qh=["title","onClick"],Yh={key:0,class:"flex flex-col items-center gap-3"},jh=["href"],Xh=fe({__name:"TailscalePanel",emits:["ssh"],setup(e,{emit:t}){const i=t,s=q([]);let r=null;const n=R=>R.userGroups.filter(N=>N.peers.length>0),o=R=>R.backendState==="Running"?R.userGroups.flatMap(N=>N.peers).filter(N=>N.exitNodeOption):[],a=R=>{switch(R){case"Running":return"bg-success/15 text-success";case"NeedsLogin":case"NeedsMachineAuth":return"bg-error/15 text-error";case"Starting":return"bg-warning/15 text-warning";default:return"bg-base-content/10 text-base-content/60"}},h=R=>{Bt()?.client.tailscaleLogout({endpointTag:R})},l=q(),d=q(!1),c=(R,N,k)=>{l.value={endpoint:R,peer:N,isSelf:k},d.value=!0},u=q(),v=q(!1),_=R=>{u.value={endpoint:R,candidates:o(R)},v.value=!0},m=q(),C=q(!1),M=R=>{m.value=R,C.value=!0},H=q(),I=q(!1),f=(R,N)=>{H.value={endpoint:R,peer:N},I.value=!0},L=(R,N,k,b)=>{i("ssh",Xn(R.endpointTag,N,k,b)),d.value=!1},B=(R,N)=>{const k=Dt.value[N.stableID];k?.remember?L(R,N,k.username,k.terminalType):f(R,N)},U=()=>{const R=l.value;R&&(d.value=!1,B(R.endpoint,R.peer))},V=()=>{const R=l.value;R&&(d.value=!1,f(R.endpoint,R.peer))},F=(R,N,k)=>{const b=H.value;b&&(k&&Ll(b.peer.stableID,{username:R,terminalType:N,remember:k}),L(b.endpoint,b.peer,R,N))};return Ht(()=>{Bt()&&(r=ir(R=>sr(rr.method.subscribeTailscaleStatus,{},R),R=>s.value=R.endpoints))}),ot(()=>r?.close()),(R,N)=>(g(),x("div",bh,[s.value.length===0?(g(),x("div",Sh,E(R.$t("noEndpoints")),1)):W("",!0),(g(!0),x(ie,null,ve(s.value,k=>(g(),x(ie,{key:k.endpointTag},[p("div",wh,[p("span",yh,[p("span",Ch,E(k.endpointTag||"Tailscale"),1),p("span",{class:Ne(["rounded-full px-2 py-0.5 text-[0.65rem] font-medium tracking-normal",a(k.backendState)])},E(k.backendState||R.$t("unknown")),3)]),k.keyAuth?W("",!0):(g(),x("button",{key:0,class:"text-error/90 hover:text-error flex items-center gap-1 text-xs font-medium tracking-normal",onClick:b=>h(k.endpointTag)},[Y(A(aa),{class:"h-4 w-4"}),ue(" "+E(R.$t("logout")),1)],8,kh))]),p("div",xh,[k.self?(g(),x("button",{key:0,class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:b=>c(k,k.self,!0)},[p("span",Bh,E(R.$t("thisDevice")),1),p("span",Dh,E(A(nt)(k.self)),1),Y(A(Ci),{class:"text-base-content/25 h-4 w-4 shrink-0"})],8,Eh)):W("",!0),o(k).length>0?(g(),x("button",{key:1,class:"setting-item hover:bg-base-content/3 active:bg-base-content/5 w-full text-left transition-colors",onClick:b=>_(k)},[p("span",Rh,E(R.$t("exitNode")),1),p("span",Lh,E(k.exitNode?A(nt)(k.exitNode):R.$t("disabledLabel")),1),Y(A(Ci),{class:"text-base-content/25 h-4 w-4 shrink-0"})],8,Mh)):W("",!0),k.networkName?(g(),x("div",Ph,[p("span",Th,E(R.$t("networkLabel")),1),p("span",Ah,E(k.networkName),1)])):W("",!0),k.authURL?(g(),x("div",Ih,[p("span",Nh,E(R.$t("authURL")),1),p("a",{href:k.authURL,target:"_blank",class:"link link-primary truncate text-sm"},E(k.authURL),9,Oh),p("button",{class:"text-base-content/40 hover:text-base-content/70 shrink-0 transition-colors",title:R.$t("showAuthQR"),onClick:b=>M(k)},[Y(A(ca),{class:"h-5 w-5"})],8,$h)])):W("",!0)]),(g(!0),x(ie,null,ve(n(k),b=>(g(),x(ie,{key:b.userID.toString()},[p("div",Hh,E(b.displayName||b.loginName||R.$t("peers")),1),p("div",Fh,[(g(!0),x(ie,null,ve(b.peers,P=>(g(),x("div",{key:P.stableID,class:"setting-item"},[p("button",{class:"flex min-w-0 flex-1 items-center gap-2.5 text-left",onClick:O=>c(k,P,!1)},[p("span",{class:Ne(["inline-block h-2 w-2 shrink-0 rounded-full",P.online?"bg-success":"bg-base-content/20"])},null,2),p("span",Wh,E(A(nt)(P)),1),p("span",Uh,E(P.tailscaleIPs[0]),1)],8,zh),P.exitNode||P.exitNodeOption?(g(),x("span",{key:0,class:Ne(["shrink-0 rounded-full px-2 py-0.5 text-[0.65rem] font-medium",P.exitNode?"bg-primary/15 text-primary":"bg-info/15 text-info"])},E(R.$t("exitNode")),3)):W("",!0),P.shareeNode?(g(),x("span",Vh,E(R.$t("sharedIn")),1)):W("",!0),P.expired?(g(),x("span",Kh,E(R.$t("expired")),1)):W("",!0),A(jn)(P)?(g(),x("button",{key:3,class:"text-primary hover:bg-primary/10 shrink-0 rounded-md p-1 transition-colors",title:R.$t("connectViaSSH"),onClick:O=>B(k,P)},[Y(A(Nn),{class:"h-4 w-4"})],8,qh)):W("",!0),Y(A(Ci),{class:"text-base-content/25 h-4 w-4 shrink-0 cursor-pointer",onClick:O=>c(k,P,!1)},null,8,["onClick"])]))),128))])],64))),128))],64))),128)),l.value?(g(),j(oh,{key:1,modelValue:d.value,"onUpdate:modelValue":N[0]||(N[0]=k=>d.value=k),endpoint:l.value.endpoint,peer:l.value.peer,"is-self":l.value.isSelf,onConnectSsh:U,onEditSsh:V},null,8,["modelValue","endpoint","peer","is-self"])):W("",!0),u.value?(g(),j(Fl,{key:2,modelValue:v.value,"onUpdate:modelValue":N[1]||(N[1]=k=>v.value=k),endpoint:u.value.endpoint,candidates:u.value.candidates},null,8,["modelValue","endpoint","candidates"])):W("",!0),H.value?(g(),j(mh,{key:3,modelValue:I.value,"onUpdate:modelValue":N[2]||(N[2]=k=>I.value=k),peer:H.value.peer,onConnect:F},null,8,["modelValue","peer"])):W("",!0),Y($t,{modelValue:C.value,"onUpdate:modelValue":N[3]||(N[3]=k=>C.value=k),title:R.$t("authURL")},{default:J(()=>[m.value?(g(),x("div",Yh,[Y(Rl,{value:m.value.authURL},null,8,["value"]),p("a",{href:m.value.authURL,target:"_blank",class:"link link-primary text-xs break-all"},E(m.value.authURL),9,jh)])):W("",!0)]),_:1},8,["modelValue","title"])]))}}),St="\x1B",Gh=[{kind:"special",id:"esc",label:"esc"},{kind:"special",id:"tab",label:"tab"},{kind:"modifier",mod:"ctrl",label:"⌃"},{kind:"modifier",mod:"alt",label:"⌥"},{kind:"divider"},{kind:"special",id:"left",label:"←"},{kind:"special",id:"up",label:"↑"},{kind:"special",id:"down",label:"↓"},{kind:"special",id:"right",label:"→"},{kind:"divider"},{kind:"text",char:"|"},{kind:"text",char:"/"},{kind:"text",char:"~"},{kind:"text",char:"-"},{kind:"text",char:"_"},{kind:"text",char:"`"},{kind:"text",char:"'"},{kind:"text",char:'"'},{kind:"paste"}],Zh=e=>{if(e.length!==1)return null;if(e===" ")return"\0";const t=e.toUpperCase().charCodeAt(0);return t>=64&&t<=95?String.fromCharCode(t&31):null},xr=(e,t)=>{let i=e;if(t.ctrl!=="off"&&e.length===1){const s=Zh(e);s!==null&&(i=s)}return t.alt!=="off"&&(i=St+i),i},Jh={up:"A",down:"B",right:"C",left:"D"},Qh=(e,t)=>{if(e==="esc")return t.alt!=="off"?St+St:St;if(e==="tab")return t.alt!=="off"?St+" ":" ";const i=Jh[e],s=1+(t.alt!=="off"?2:0)+(t.ctrl!=="off"?4:0);return s===1?St+"["+i:St+"[1;"+s+i},ec=e=>e.ctrl!=="off"||e.alt!=="off",tc=(e,t)=>{switch(e){case"off":return"armed";case"armed":return t?"locked":"off";case"locked":return"off"}},ic=(e,t,i)=>({...e,[t]:tc(e[t],i)}),Xi=e=>({ctrl:e.ctrl==="armed"?"off":e.ctrl,alt:e.alt==="armed"?"off":e.alt}),sc=["aria-label"],rc={key:0,class:"bg-base-content/30 mx-0.5 h-1.5 w-1.5 flex-none rounded-full","aria-hidden":"true"},nc=["aria-pressed","onClick"],oc=["aria-label"],ac=["aria-label","onClick"],lc=["aria-label","onClick"],fi="bg-base-300 text-base-content flex h-9 min-w-9 flex-none items-center justify-center rounded-md px-2 text-sm active:bg-primary/30",hc=fe({__name:"TerminalSymbolBar",props:{modifiers:{}},emits:["modifier","key","paste"],setup(e,{emit:t}){const i=t,s=r=>r==="locked"?"bg-primary! text-primary-content!":r==="armed"?"bg-primary/20! ring-primary ring-[1.5px] ring-inset":"";return(r,n)=>(g(),x("div",{class:"border-base-300 bg-base-200/95 flex w-full flex-none items-center gap-1.5 overflow-x-auto border-t px-2.5 py-1 backdrop-blur-lg",style:{"padding-bottom":"calc(0.25rem + env(safe-area-inset-bottom, 0px))"},role:"toolbar","aria-label":r.$t("terminalKeys")},[(g(!0),x(ie,null,ve(A(Gh),(o,a)=>(g(),x(ie,{key:a},[o.kind==="divider"?(g(),x("span",rc)):o.kind==="modifier"?(g(),x("button",{key:1,type:"button",class:Ne([fi,s(e.modifiers[o.mod])]),"aria-pressed":e.modifiers[o.mod]!=="off",onPointerdown:n[0]||(n[0]=Xt(()=>{},["prevent"])),onClick:h=>i("modifier",o.mod)},E(o.label),43,nc)):o.kind==="paste"?(g(),x("button",{key:2,type:"button",class:Ne(fi),"aria-label":r.$t("paste"),onPointerdown:n[1]||(n[1]=Xt(()=>{},["prevent"])),onClick:n[2]||(n[2]=h=>i("paste"))},[Y(A(la),{class:"h-4 w-4"})],40,oc)):o.kind==="text"?(g(),x("button",{key:3,type:"button",class:Ne([fi,"font-mono"]),"aria-label":o.char,onPointerdown:n[3]||(n[3]=Xt(()=>{},["prevent"])),onClick:h=>i("key",o)},E(o.char),43,ac)):(g(),x("button",{key:4,type:"button",class:Ne(fi),"aria-label":o.label,onPointerdown:n[4]||(n[4]=Xt(()=>{},["prevent"])),onClick:h=>i("key",o)},E(o.label),41,lc))],64))),128))],8,sc))}}),Er='ui-monospace, SFMono-Regular, Menlo, Consolas, "DejaVu Sans Mono", monospace',Gn=13,lr="Alabaster",hr="Afterglow",cc=[8,9,10,11,12,13,14,15,16,18,20,22,24,28,32],dc=["Menlo","Monaco","SF Mono","Consolas","Cascadia Code","Fira Code","JetBrains Mono","Source Code Pro","IBM Plex Mono","Roboto Mono","Ubuntu Mono","Courier New"],uc={lightThemeName:lr,darkThemeName:hr,fontFamily:"",fontSize:Gn},Ie=Mn("config/terminal",{...uc}),Br=e=>{const t=e.fontFamily.trim();return t?`${/\s/.test(t)?`"${t}"`:t}, ${Er}`:Er},Dr=e=>e.fontSize>0?e.fontSize:Gn,cr=[{name:lr,isDark:!1,theme:{background:"#f7f7f7",foreground:"#000000",cursor:"#007acc",selectionBackground:"#bfdbfe",black:"#000000",red:"#aa3731",green:"#448c27",yellow:"#cb9000",blue:"#325cc0",magenta:"#7a3e9d",cyan:"#0083b2",white:"#b7b7b7",brightBlack:"#777777",brightRed:"#f05050",brightGreen:"#60cb00",brightYellow:"#f2af50",brightBlue:"#007acc",brightMagenta:"#e64ce6",brightCyan:"#00aacb",brightWhite:"#f7f7f7"}},{name:"Solarized Light",isDark:!1,theme:{background:"#fdf6e3",foreground:"#657b83",cursor:"#586e75",selectionBackground:"#eee8d5",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},{name:"Gruvbox Light",isDark:!1,theme:{background:"#fbf1c7",foreground:"#3c3836",cursor:"#3c3836",selectionBackground:"#ebdbb2",black:"#fbf1c7",red:"#cc241d",green:"#98971a",yellow:"#d79921",blue:"#458588",magenta:"#b16286",cyan:"#689d6a",white:"#7c6f64",brightBlack:"#928374",brightRed:"#9d0006",brightGreen:"#79740e",brightYellow:"#b57614",brightBlue:"#076678",brightMagenta:"#8f3f71",brightCyan:"#427b58",brightWhite:"#3c3836"}},{name:"Catppuccin Latte",isDark:!1,theme:{background:"#eff1f5",foreground:"#4c4f69",cursor:"#dc8a78",selectionBackground:"#ccd0da",black:"#5c5f77",red:"#d20f39",green:"#40a02b",yellow:"#df8e1d",blue:"#1e66f5",magenta:"#ea76cb",cyan:"#179299",white:"#acb0be",brightBlack:"#6c6f85",brightRed:"#d20f39",brightGreen:"#40a02b",brightYellow:"#df8e1d",brightBlue:"#1e66f5",brightMagenta:"#ea76cb",brightCyan:"#179299",brightWhite:"#bcc0cc"}},{name:"GitHub Light",isDark:!1,theme:{background:"#ffffff",foreground:"#24292e",cursor:"#24292e",selectionBackground:"#c8e1ff",black:"#24292e",red:"#d73a49",green:"#28a745",yellow:"#dbab09",blue:"#0366d6",magenta:"#5a32a3",cyan:"#0598bc",white:"#6a737d",brightBlack:"#959da5",brightRed:"#cb2431",brightGreen:"#22863a",brightYellow:"#b08800",brightBlue:"#005cc5",brightMagenta:"#5a32a3",brightCyan:"#3192aa",brightWhite:"#d1d5da"}},{name:hr,isDark:!0,theme:{background:"#212121",foreground:"#d0d0d0",cursor:"#d0d0d0",selectionBackground:"#303030",black:"#151515",red:"#ac4142",green:"#7e8e50",yellow:"#e5b567",blue:"#6c99bb",magenta:"#9f4e85",cyan:"#7dd6cf",white:"#d0d0d0",brightBlack:"#505050",brightRed:"#ac4142",brightGreen:"#7e8e50",brightYellow:"#e5b567",brightBlue:"#6c99bb",brightMagenta:"#9f4e85",brightCyan:"#7dd6cf",brightWhite:"#f5f5f5"}},{name:"Dracula",isDark:!0,theme:{background:"#282a36",foreground:"#f8f8f2",cursor:"#f8f8f2",selectionBackground:"#44475a",black:"#21222c",red:"#ff5555",green:"#50fa7b",yellow:"#f1fa8c",blue:"#bd93f9",magenta:"#ff79c6",cyan:"#8be9fd",white:"#f8f8f2",brightBlack:"#6272a4",brightRed:"#ff6e6e",brightGreen:"#69ff94",brightYellow:"#ffffa5",brightBlue:"#d6acff",brightMagenta:"#ff92df",brightCyan:"#a4ffff",brightWhite:"#ffffff"}},{name:"Nord",isDark:!0,theme:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",selectionBackground:"#434c5e",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"}},{name:"One Dark",isDark:!0,theme:{background:"#282c34",foreground:"#abb2bf",cursor:"#528bff",selectionBackground:"#3e4451",black:"#282c34",red:"#e06c75",green:"#98c379",yellow:"#e5c07b",blue:"#61afef",magenta:"#c678dd",cyan:"#56b6c2",white:"#abb2bf",brightBlack:"#5c6370",brightRed:"#e06c75",brightGreen:"#98c379",brightYellow:"#e5c07b",brightBlue:"#61afef",brightMagenta:"#c678dd",brightCyan:"#56b6c2",brightWhite:"#ffffff"}},{name:"Tokyo Night",isDark:!0,theme:{background:"#1a1b26",foreground:"#c0caf5",cursor:"#c0caf5",selectionBackground:"#33467c",black:"#15161e",red:"#f7768e",green:"#9ece6a",yellow:"#e0af68",blue:"#7aa2f7",magenta:"#bb9af7",cyan:"#7dcfff",white:"#a9b1d6",brightBlack:"#414868",brightRed:"#f7768e",brightGreen:"#9ece6a",brightYellow:"#e0af68",brightBlue:"#7aa2f7",brightMagenta:"#bb9af7",brightCyan:"#7dcfff",brightWhite:"#c0caf5"}},{name:"Monokai",isDark:!0,theme:{background:"#272822",foreground:"#f8f8f2",cursor:"#f8f8f2",selectionBackground:"#49483e",black:"#272822",red:"#f92672",green:"#a6e22e",yellow:"#f4bf75",blue:"#66d9ef",magenta:"#ae81ff",cyan:"#a1efe4",white:"#f8f8f2",brightBlack:"#75715e",brightRed:"#f92672",brightGreen:"#a6e22e",brightYellow:"#f4bf75",brightBlue:"#66d9ef",brightMagenta:"#ae81ff",brightCyan:"#a1efe4",brightWhite:"#f9f8f5"}},{name:"Solarized Dark",isDark:!0,theme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",selectionBackground:"#073642",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"}},{name:"Gruvbox Dark",isDark:!0,theme:{background:"#282828",foreground:"#ebdbb2",cursor:"#ebdbb2",selectionBackground:"#3c3836",black:"#282828",red:"#cc241d",green:"#98971a",yellow:"#d79921",blue:"#458588",magenta:"#b16286",cyan:"#689d6a",white:"#a89984",brightBlack:"#928374",brightRed:"#fb4934",brightGreen:"#b8bb26",brightYellow:"#fabd2f",brightBlue:"#83a598",brightMagenta:"#d3869b",brightCyan:"#8ec07c",brightWhite:"#ebdbb2"}},{name:"Catppuccin Mocha",isDark:!0,theme:{background:"#1e1e2e",foreground:"#cdd6f4",cursor:"#f5e0dc",selectionBackground:"#585b70",black:"#45475a",red:"#f38ba8",green:"#a6e3a1",yellow:"#f9e2af",blue:"#89b4fa",magenta:"#f5c2e7",cyan:"#94e2d5",white:"#bac2de",brightBlack:"#585b70",brightRed:"#f38ba8",brightGreen:"#a6e3a1",brightYellow:"#f9e2af",brightBlue:"#89b4fa",brightMagenta:"#f5c2e7",brightCyan:"#94e2d5",brightWhite:"#a6adc8"}},{name:"Night Owl",isDark:!0,theme:{background:"#011627",foreground:"#d6deeb",cursor:"#80a4c2",selectionBackground:"#1d3b53",black:"#011627",red:"#ef5350",green:"#22da6e",yellow:"#c5e478",blue:"#82aaff",magenta:"#c792ea",cyan:"#21c7a8",white:"#ffffff",brightBlack:"#575656",brightRed:"#ef5350",brightGreen:"#22da6e",brightYellow:"#ffeb95",brightBlue:"#82aaff",brightMagenta:"#c792ea",brightCyan:"#7fdbca",brightWhite:"#ffffff"}}],_c=e=>{const t=e?hr:lr;return cr.find(i=>i.name===t).theme},Mr=e=>cr.filter(t=>t.isDark===e),fc=(e,t)=>{const i=t?e.darkThemeName:e.lightThemeName;return cr.find(s=>s.name===i)?.theme??_c(t)},pc=()=>{const e=q(0),t=()=>{const i=window.visualViewport;if(!i)return;const s=window.innerHeight-i.height-i.offsetTop;e.value=s>1?Math.round(s):0};return Ht(()=>{const i=window.visualViewport;i&&(t(),i.addEventListener("resize",t),i.addEventListener("scroll",t))}),ot(()=>{window.visualViewport?.removeEventListener("resize",t),window.visualViewport?.removeEventListener("scroll",t)}),e};var gc=2,vc=1,mc=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,i=window.getComputedStyle(this._terminal.element.parentElement),s=parseInt(i.getPropertyValue("height")),r=Math.max(0,parseInt(i.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),o={top:parseInt(n.getPropertyValue("padding-top")),bottom:parseInt(n.getPropertyValue("padding-bottom")),right:parseInt(n.getPropertyValue("padding-right")),left:parseInt(n.getPropertyValue("padding-left"))},a=o.top+o.bottom,h=o.right+o.left,l=s-a,d=r-h-t;return{cols:Math.max(gc,Math.floor(d/e.css.cell.width)),rows:Math.max(vc,Math.floor(l/e.css.cell.height))}}};var Zn=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,Sc=(e,t)=>{for(var i in t)Zn(e,i,{get:t[i],enumerable:!0})},he=(e,t,i,s)=>{for(var r=s>1?void 0:s?bc(t,i):t,n=e.length-1,o;n>=0;n--)(o=e[n])&&(r=(s?o(t,i,r):o(r))||r);return s&&r&&Zn(t,i,r),r},$=(e,t)=>(i,s)=>t(i,s,e),Rr="Terminal input",ps={get:()=>Rr,set:e=>Rr=e},Lr="Too much output to announce, navigate to rows manually to read",gs={get:()=>Lr,set:e=>Lr=e};function wc(e){return e.replace(/\r?\n/g,"\r")}function yc(e,t){return t?"\x1B[200~"+e+"\x1B[201~":e}function Cc(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()}function kc(e,t,i,s){if(e.stopPropagation(),e.clipboardData){let r=e.clipboardData.getData("text/plain");Jn(r,t,i,s)}}function Jn(e,t,i,s){e=wc(e),e=yc(e,i.decPrivateModes.bracketedPasteMode&&s.rawOptions.ignoreBracketedPasteMode!==!0),i.triggerDataEvent(e,!0),t.value=""}function Qn(e,t,i){let s=i.getBoundingClientRect(),r=e.clientX-s.left-10,n=e.clientY-s.top-10;t.style.width="20px",t.style.height="20px",t.style.left=`${r}px`,t.style.top=`${n}px`,t.style.zIndex="1000",t.focus()}function Pr(e,t,i,s,r){Qn(e,t,i),r&&s.rightClickSelect(e),t.value=s.selectionText,t.select()}function ft(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function zi(e,t=0,i=e.length){let s="";for(let r=t;r65535?(n-=65536,s+=String.fromCharCode((n>>10)+55296)+String.fromCharCode(n%1024+56320)):s+=String.fromCharCode(n)}return s}var xc=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r=0;if(this._interim){let n=e.charCodeAt(r++);56320<=n&&n<=57343?t[s++]=(this._interim-55296)*1024+n-56320+65536:(t[s++]=this._interim,t[s++]=n),this._interim=0}for(let n=r;n=i)return this._interim=o,s;let a=e.charCodeAt(n);56320<=a&&a<=57343?t[s++]=(o-55296)*1024+a-56320+65536:(t[s++]=o,t[s++]=a);continue}o!==65279&&(t[s++]=o)}return s}},Ec=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let i=e.length;if(!i)return 0;let s=0,r,n,o,a,h=0,l=0;if(this.interim[0]){let u=!1,v=this.interim[0];v&=(v&224)===192?31:(v&240)===224?15:7;let _=0,m;for(;(m=this.interim[++_]&63)&&_<4;)v<<=6,v|=m;let C=(this.interim[0]&224)===192?2:(this.interim[0]&240)===224?3:4,M=C-_;for(;l=i)return 0;if(m=e[l++],(m&192)!==128){l--,u=!0;break}else this.interim[_++]=m,v<<=6,v|=m&63}u||(C===2?v<128?l--:t[s++]=v:C===3?v<2048||v>=55296&&v<=57343||v===65279||(t[s++]=v):v<65536||v>1114111||(t[s++]=v)),this.interim.fill(0)}let d=i-4,c=l;for(;c=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(h=(r&31)<<6|n&63,h<128){c--;continue}t[s++]=h}else if((r&240)===224){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(h=(r&15)<<12|(n&63)<<6|o&63,h<2048||h>=55296&&h<=57343||h===65279)continue;t[s++]=h}else if((r&248)===240){if(c>=i)return this.interim[0]=r,s;if(n=e[c++],(n&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,s;if(o=e[c++],(o&192)!==128){c--;continue}if(c>=i)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,s;if(a=e[c++],(a&192)!==128){c--;continue}if(h=(r&7)<<18|(n&63)<<12|(o&63)<<6|a&63,h<65536||h>1114111)continue;t[s++]=h}}return s}},eo="",pt=" ",ai=class to{constructor(){this.fg=0,this.bg=0,this.extended=new Ai}static toColorRGB(t){return[t>>>16&255,t>>>8&255,t&255]}static fromColorRGB(t){return(t[0]&255)<<16|(t[1]&255)<<8|t[2]&255}clone(){let t=new to;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)===50331648}isBgRGB(){return(this.bg&50331648)===50331648}isFgPalette(){return(this.fg&50331648)===16777216||(this.fg&50331648)===33554432}isBgPalette(){return(this.bg&50331648)===16777216||(this.bg&50331648)===33554432}isFgDefault(){return(this.fg&50331648)===0}isBgDefault(){return(this.bg&50331648)===0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===16777216||(this.extended.underlineColor&50331648)===33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},Ai=class io{constructor(t=0,i=0){this._ext=0,this._urlId=0,this._ext=t,this._urlId=i}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(t){this._ext=t}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(t){this._ext&=-469762049,this._ext|=t<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(t){this._ext&=-67108864,this._ext|=t&67108863}get urlId(){return this._urlId}set urlId(t){this._urlId=t}get underlineVariantOffset(){let t=(this._ext&3758096384)>>29;return t<0?t^4294967288:t}set underlineVariantOffset(t){this._ext&=536870911,this._ext|=t<<29&3758096384}clone(){return new io(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},Ve=class so extends ai{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Ai,this.combinedData=""}static fromCharData(t){let i=new so;return i.setFromCharData(t),i}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?ft(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(t){this.fg=t[0],this.bg=0;let i=!1;if(t[1].length>2)i=!0;else if(t[1].length===2){let s=t[1].charCodeAt(0);if(55296<=s&&s<=56319){let r=t[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(s-55296)*1024+r-56320+65536|t[2]<<22:i=!0}else i=!0}else this.content=t[1].charCodeAt(0)|t[2]<<22;i&&(this.combinedData=t[1],this.content=2097152|t[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Tr="di$target",vs="di$dependencies",Gi=new Map;function Bc(e){return e[vs]||[]}function Ce(e){if(Gi.has(e))return Gi.get(e);let t=function(i,s,r){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");Dc(t,i,r)};return t._id=e,Gi.set(e,t),t}function Dc(e,t,i){t[Tr]===t?t[vs].push({id:e,index:i}):(t[vs]=[{id:e,index:i}],t[Tr]=t)}var Le=Ce("BufferService"),ro=Ce("CoreMouseService"),Lt=Ce("CoreService"),Mc=Ce("CharsetService"),dr=Ce("InstantiationService"),no=Ce("LogService"),Pe=Ce("OptionsService"),oo=Ce("OscLinkService"),Rc=Ce("UnicodeService"),li=Ce("DecorationService"),ms=class{constructor(e,t,i){this._bufferService=e,this._optionsService=t,this._oscLinkService=i}provideLinks(e,t){let i=this._bufferService.buffer.lines.get(e-1);if(!i){t(void 0);return}let s=[],r=this._optionsService.rawOptions.linkHandler,n=new Ve,o=i.getTrimmedLength(),a=-1,h=-1,l=!1;for(let d=0;dr?r.activate(_,m,u):Lc(_,m),hover:(_,m)=>r?.hover?.(_,m,u),leave:(_,m)=>r?.leave?.(_,m,u)})}l=!1,n.hasExtendedAttrs()&&n.extended.urlId?(h=d,a=n.extended.urlId):(h=-1,a=-1)}}t(s)}};ms=he([$(0,Le),$(1,Pe),$(2,oo)],ms);function Lc(e,t){if(confirm(`Do you want to navigate to ${t}? -WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Wi=Ce("CharSizeService"),at=Ce("CoreBrowserService"),cr=Ce("MouseService"),lt=Ce("RenderService"),Ac=Ce("SelectionService"),no=Ce("CharacterJoinerService"),Ft=Ce("ThemeService"),oo=Ce("LinkProviderService"),Ic=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Pr.isErrorNoTelemetry(e)?new Pr(e.message+` +WARNING: This link could potentially be dangerous`)){let i=window.open();if(i){try{i.opener=null}catch{}i.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}var Wi=Ce("CharSizeService"),at=Ce("CoreBrowserService"),ur=Ce("MouseService"),lt=Ce("RenderService"),Pc=Ce("SelectionService"),ao=Ce("CharacterJoinerService"),Ft=Ce("ThemeService"),lo=Ce("LinkProviderService"),Tc=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?Ar.isErrorNoTelemetry(e)?new Ar(e.message+` `+e.stack):new Error(e.message+` -`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Nc=new Ic;function Ei(e){Oc(e)||Nc.onUnexpectedError(e)}var bs="Canceled";function Oc(e){return e instanceof $c?!0:e instanceof Error&&e.name===bs&&e.message===bs}var $c=class extends Error{constructor(){super(bs),this.name=this.message}};function Hc(e){return new Error(`Illegal argument: ${e}`)}var Pr=class Ss extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Ss)return t;let i=new Ss;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},ws=class ao extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,ao.prototype)}};function Oe(e,t=0){return e[e.length-(1+t)]}var Fc;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(Fc||={});function zc(e,t){let i=this,s=!1,r;return function(){return s||(s=!0,t||(r=e.apply(i,arguments))),r}}var lo;(e=>{function t(f){return f&&typeof f=="object"&&typeof f[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(f){yield f}e.single=r;function n(f){return t(f)?f:r(f)}e.wrap=n;function o(f){return f||i}e.from=o;function*a(f){for(let R=f.length-1;R>=0;R--)yield f[R]}e.reverse=a;function h(f){return!f||f[Symbol.iterator]().next().done===!0}e.isEmpty=h;function l(f){return f[Symbol.iterator]().next().value}e.first=l;function d(f,R){let B=0;for(let U of f)if(R(U,B++))return!0;return!1}e.some=d;function c(f,R){for(let B of f)if(R(B))return B}e.find=c;function*u(f,R){for(let B of f)R(B)&&(yield B)}e.filter=u;function*v(f,R){let B=0;for(let U of f)yield R(U,B++)}e.map=v;function*_(f,R){let B=0;for(let U of f)yield*R(U,B++)}e.flatMap=_;function*m(...f){for(let R of f)yield*R}e.concat=m;function C(f,R,B){let U=B;for(let L of f)U=R(U,L);return U}e.reduce=C;function*M(f,R,B=f.length){for(R<0&&(R+=f.length),B<0?B+=f.length:B>f.length&&(B=f.length);R1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Wc(...e){return ne(()=>Mt(e))}function ne(e){return{dispose:zc(()=>{e()})}}var ho=class co{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Mt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?co.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};ho.DISABLE_DISPOSED_WARNING=!1;var vt=ho,G=class{constructor(){this._store=new vt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};G.None=Object.freeze({dispose(){}});var Nt=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},st=typeof window=="object"?window:globalThis,ys=class Cs{constructor(t){this.element=t,this.next=Cs.Undefined,this.prev=Cs.Undefined}};ys.Undefined=new ys(void 0);var oe=ys,Tr=class{constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let e=this._first;for(;e!==oe.Undefined;){let t=e.next;e.prev=oe.Undefined,e.next=oe.Undefined,e=t}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new oe(e);if(this._first===oe.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==oe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==oe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==oe.Undefined&&e.next!==oe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===oe.Undefined&&e.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):e.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):e.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==oe.Undefined;)yield e.element,e=e.next}},Uc=globalThis.performance&&typeof globalThis.performance.now=="function",Vc=class uo{static create(t){return new uo(t)}constructor(t){this._now=Uc&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},ke;(e=>{e.None=()=>G.None;function t(k,b){return c(k,()=>{},0,void 0,!0,void 0,b)}e.defer=t;function i(k){return(b,P=null,O)=>{let D=!1,w;return w=k(S=>{if(!D)return w?w.dispose():D=!0,b.call(P,S)},null,O),D&&w.dispose(),w}}e.once=i;function s(k,b,P){return l((O,D=null,w)=>k(S=>O.call(D,b(S)),null,w),P)}e.map=s;function r(k,b,P){return l((O,D=null,w)=>k(S=>{b(S),O.call(D,S)},null,w),P)}e.forEach=r;function n(k,b,P){return l((O,D=null,w)=>k(S=>b(S)&&O.call(D,S),null,w),P)}e.filter=n;function o(k){return k}e.signal=o;function a(...k){return(b,P=null,O)=>{let D=Wc(...k.map(w=>w(S=>b.call(P,S))));return d(D,O)}}e.any=a;function h(k,b,P,O){let D=P;return s(k,w=>(D=b(D,w),D),O)}e.reduce=h;function l(k,b){let P,O={onWillAddFirstListener(){P=k(D.fire,D)},onDidRemoveLastListener(){P?.dispose()}},D=new T(O);return b?.add(D),D.event}function d(k,b){return b instanceof Array?b.push(k):b&&b.add(k),k}function c(k,b,P=100,O=!1,D=!1,w,S){let z,Z,se,xe=0,De,Te={leakWarningThreshold:w,onWillAddFirstListener(){z=k(Fe=>{xe++,Z=b(Z,Fe),O&&!se&&(qe.fire(Z),Z=void 0),De=()=>{let mt=Z;Z=void 0,se=void 0,(!O||xe>1)&&qe.fire(mt),xe=0},typeof P=="number"?(clearTimeout(se),se=setTimeout(De,P)):se===void 0&&(se=0,queueMicrotask(De))})},onWillRemoveListener(){D&&xe>0&&De?.()},onDidRemoveLastListener(){De=void 0,z.dispose()}},qe=new T(Te);return S?.add(qe),qe.event}e.debounce=c;function u(k,b=0,P){return e.debounce(k,(O,D)=>O?(O.push(D),O):[D],b,void 0,!0,void 0,P)}e.accumulate=u;function v(k,b=(O,D)=>O===D,P){let O=!0,D;return n(k,w=>{let S=O||!b(w,D);return O=!1,D=w,S},P)}e.latch=v;function _(k,b,P){return[e.filter(k,b,P),e.filter(k,O=>!b(O),P)]}e.split=_;function m(k,b=!1,P=[],O){let D=P.slice(),w=k(Z=>{D?D.push(Z):z.fire(Z)});O&&O.add(w);let S=()=>{D?.forEach(Z=>z.fire(Z)),D=null},z=new T({onWillAddFirstListener(){w||(w=k(Z=>z.fire(Z)),O&&O.add(w))},onDidAddFirstListener(){D&&(b?setTimeout(S):S())},onDidRemoveLastListener(){w&&w.dispose(),w=null}});return O&&O.add(z),z.event}e.buffer=m;function C(k,b){return(P,O,D)=>{let w=b(new F);return k(function(S){let z=w.evaluate(S);z!==M&&P.call(O,z)},void 0,D)}}e.chain=C;let M=Symbol("HaltChainable");class F{constructor(){this.steps=[]}map(b){return this.steps.push(b),this}forEach(b){return this.steps.push(P=>(b(P),P)),this}filter(b){return this.steps.push(P=>b(P)?P:M),this}reduce(b,P){let O=P;return this.steps.push(D=>(O=b(O,D),O)),this}latch(b=(P,O)=>P===O){let P=!0,O;return this.steps.push(D=>{let w=P||!b(D,O);return P=!1,O=D,w?D:M}),this}evaluate(b){for(let P of this.steps)if(b=P(b),b===M)break;return b}}function N(k,b,P=O=>O){let O=(...z)=>S.fire(P(...z)),D=()=>k.on(b,O),w=()=>k.removeListener(b,O),S=new T({onWillAddFirstListener:D,onDidRemoveLastListener:w});return S.event}e.fromNodeEventEmitter=N;function f(k,b,P=O=>O){let O=(...z)=>S.fire(P(...z)),D=()=>k.addEventListener(b,O),w=()=>k.removeEventListener(b,O),S=new T({onWillAddFirstListener:D,onDidRemoveLastListener:w});return S.event}e.fromDOMEventEmitter=f;function R(k){return new Promise(b=>i(k)(b))}e.toPromise=R;function B(k){let b=new T;return k.then(P=>{b.fire(P)},()=>{b.fire(void 0)}).finally(()=>{b.dispose()}),b.event}e.fromPromise=B;function U(k,b){return k(P=>b.fire(P))}e.forward=U;function L(k,b,P){return b(P),k(O=>b(O))}e.runAndSubscribe=L;class K{constructor(b,P){this._observable=b,this._counter=0,this._hasChanged=!1;let O={onWillAddFirstListener:()=>{b.addObserver(this)},onDidRemoveLastListener:()=>{b.removeObserver(this)}};this.emitter=new T(O),P&&P.add(this.emitter)}beginUpdate(b){this._counter++}handlePossibleChange(b){}handleChange(b,P){this._hasChanged=!0}endUpdate(b){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function I(k,b){return new K(k,b).emitter.event}e.fromObservable=I;function H(k){return(b,P,O)=>{let D=0,w=!1,S={beginUpdate(){D++},endUpdate(){D--,D===0&&(k.reportChanges(),w&&(w=!1,b.call(P)))},handlePossibleChange(){},handleChange(){w=!0}};k.addObserver(S),k.reportChanges();let z={dispose(){k.removeObserver(S)}};return O instanceof vt?O.add(z):Array.isArray(O)&&O.push(z),z}}e.fromObservableLight=H})(ke||={});var ks=class xs{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${xs._idPool++}`,xs.all.add(this)}start(t){this._stopWatch=new Vc,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};ks.all=new Set,ks._idPool=0;var Kc=ks,qc=-1,_o=class fo{constructor(t,i,s=(fo._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}},Ac=new Tc;function Ei(e){Ic(e)||Ac.onUnexpectedError(e)}var bs="Canceled";function Ic(e){return e instanceof Nc?!0:e instanceof Error&&e.name===bs&&e.message===bs}var Nc=class extends Error{constructor(){super(bs),this.name=this.message}};function Oc(e){return new Error(`Illegal argument: ${e}`)}var Ar=class Ss extends Error{constructor(t){super(t),this.name="CodeExpectedError"}static fromError(t){if(t instanceof Ss)return t;let i=new Ss;return i.message=t.message,i.stack=t.stack,i}static isErrorNoTelemetry(t){return t.name==="CodeExpectedError"}},ws=class ho extends Error{constructor(t){super(t||"An unexpected bug occurred."),Object.setPrototypeOf(this,ho.prototype)}};function Oe(e,t=0){return e[e.length-(1+t)]}var $c;(e=>{function t(n){return n<0}e.isLessThan=t;function i(n){return n<=0}e.isLessThanOrEqual=i;function s(n){return n>0}e.isGreaterThan=s;function r(n){return n===0}e.isNeitherLessOrGreaterThan=r,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})($c||={});function Hc(e,t){let i=this,s=!1,r;return function(){return s||(s=!0,t||(r=e.apply(i,arguments))),r}}var co;(e=>{function t(f){return f&&typeof f=="object"&&typeof f[Symbol.iterator]=="function"}e.is=t;let i=Object.freeze([]);function s(){return i}e.empty=s;function*r(f){yield f}e.single=r;function n(f){return t(f)?f:r(f)}e.wrap=n;function o(f){return f||i}e.from=o;function*a(f){for(let L=f.length-1;L>=0;L--)yield f[L]}e.reverse=a;function h(f){return!f||f[Symbol.iterator]().next().done===!0}e.isEmpty=h;function l(f){return f[Symbol.iterator]().next().value}e.first=l;function d(f,L){let B=0;for(let U of f)if(L(U,B++))return!0;return!1}e.some=d;function c(f,L){for(let B of f)if(L(B))return B}e.find=c;function*u(f,L){for(let B of f)L(B)&&(yield B)}e.filter=u;function*v(f,L){let B=0;for(let U of f)yield L(U,B++)}e.map=v;function*_(f,L){let B=0;for(let U of f)yield*L(U,B++)}e.flatMap=_;function*m(...f){for(let L of f)yield*L}e.concat=m;function C(f,L,B){let U=B;for(let V of f)U=L(U,V);return U}e.reduce=C;function*M(f,L,B=f.length){for(L<0&&(L+=f.length),B<0?B+=f.length:B>f.length&&(B=f.length);L1)throw new AggregateError(t,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Fc(...e){return ne(()=>Mt(e))}function ne(e){return{dispose:Hc(()=>{e()})}}var uo=class _o{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{Mt(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?_o.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(t),t}delete(t){if(t){if(t===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(t),t.dispose()}}deleteAndLeak(t){t&&this._toDispose.has(t)&&(this._toDispose.delete(t),void 0)}};uo.DISABLE_DISPOSED_WARNING=!1;var vt=uo,G=class{constructor(){this._store=new vt,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};G.None=Object.freeze({dispose(){}});var Nt=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},rt=typeof window=="object"?window:globalThis,ys=class Cs{constructor(t){this.element=t,this.next=Cs.Undefined,this.prev=Cs.Undefined}};ys.Undefined=new ys(void 0);var oe=ys,Ir=class{constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let e=this._first;for(;e!==oe.Undefined;){let t=e.next;e.prev=oe.Undefined,e.next=oe.Undefined,e=t}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let i=new oe(e);if(this._first===oe.Undefined)this._first=i,this._last=i;else if(t){let r=this._last;this._last=i,i.prev=r,r.next=i}else{let r=this._first;this._first=i,i.next=r,r.prev=i}this._size+=1;let s=!1;return()=>{s||(s=!0,this._remove(i))}}shift(){if(this._first!==oe.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==oe.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==oe.Undefined&&e.next!==oe.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===oe.Undefined&&e.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):e.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):e.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==oe.Undefined;)yield e.element,e=e.next}},zc=globalThis.performance&&typeof globalThis.performance.now=="function",Wc=class fo{static create(t){return new fo(t)}constructor(t){this._now=zc&&t===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}},ke;(e=>{e.None=()=>G.None;function t(k,b){return c(k,()=>{},0,void 0,!0,void 0,b)}e.defer=t;function i(k){return(b,P=null,O)=>{let D=!1,w;return w=k(S=>{if(!D)return w?w.dispose():D=!0,b.call(P,S)},null,O),D&&w.dispose(),w}}e.once=i;function s(k,b,P){return l((O,D=null,w)=>k(S=>O.call(D,b(S)),null,w),P)}e.map=s;function r(k,b,P){return l((O,D=null,w)=>k(S=>{b(S),O.call(D,S)},null,w),P)}e.forEach=r;function n(k,b,P){return l((O,D=null,w)=>k(S=>b(S)&&O.call(D,S),null,w),P)}e.filter=n;function o(k){return k}e.signal=o;function a(...k){return(b,P=null,O)=>{let D=Fc(...k.map(w=>w(S=>b.call(P,S))));return d(D,O)}}e.any=a;function h(k,b,P,O){let D=P;return s(k,w=>(D=b(D,w),D),O)}e.reduce=h;function l(k,b){let P,O={onWillAddFirstListener(){P=k(D.fire,D)},onDidRemoveLastListener(){P?.dispose()}},D=new T(O);return b?.add(D),D.event}function d(k,b){return b instanceof Array?b.push(k):b&&b.add(k),k}function c(k,b,P=100,O=!1,D=!1,w,S){let z,Z,se,xe=0,De,Te={leakWarningThreshold:w,onWillAddFirstListener(){z=k(Fe=>{xe++,Z=b(Z,Fe),O&&!se&&(qe.fire(Z),Z=void 0),De=()=>{let mt=Z;Z=void 0,se=void 0,(!O||xe>1)&&qe.fire(mt),xe=0},typeof P=="number"?(clearTimeout(se),se=setTimeout(De,P)):se===void 0&&(se=0,queueMicrotask(De))})},onWillRemoveListener(){D&&xe>0&&De?.()},onDidRemoveLastListener(){De=void 0,z.dispose()}},qe=new T(Te);return S?.add(qe),qe.event}e.debounce=c;function u(k,b=0,P){return e.debounce(k,(O,D)=>O?(O.push(D),O):[D],b,void 0,!0,void 0,P)}e.accumulate=u;function v(k,b=(O,D)=>O===D,P){let O=!0,D;return n(k,w=>{let S=O||!b(w,D);return O=!1,D=w,S},P)}e.latch=v;function _(k,b,P){return[e.filter(k,b,P),e.filter(k,O=>!b(O),P)]}e.split=_;function m(k,b=!1,P=[],O){let D=P.slice(),w=k(Z=>{D?D.push(Z):z.fire(Z)});O&&O.add(w);let S=()=>{D?.forEach(Z=>z.fire(Z)),D=null},z=new T({onWillAddFirstListener(){w||(w=k(Z=>z.fire(Z)),O&&O.add(w))},onDidAddFirstListener(){D&&(b?setTimeout(S):S())},onDidRemoveLastListener(){w&&w.dispose(),w=null}});return O&&O.add(z),z.event}e.buffer=m;function C(k,b){return(P,O,D)=>{let w=b(new H);return k(function(S){let z=w.evaluate(S);z!==M&&P.call(O,z)},void 0,D)}}e.chain=C;let M=Symbol("HaltChainable");class H{constructor(){this.steps=[]}map(b){return this.steps.push(b),this}forEach(b){return this.steps.push(P=>(b(P),P)),this}filter(b){return this.steps.push(P=>b(P)?P:M),this}reduce(b,P){let O=P;return this.steps.push(D=>(O=b(O,D),O)),this}latch(b=(P,O)=>P===O){let P=!0,O;return this.steps.push(D=>{let w=P||!b(D,O);return P=!1,O=D,w?D:M}),this}evaluate(b){for(let P of this.steps)if(b=P(b),b===M)break;return b}}function I(k,b,P=O=>O){let O=(...z)=>S.fire(P(...z)),D=()=>k.on(b,O),w=()=>k.removeListener(b,O),S=new T({onWillAddFirstListener:D,onDidRemoveLastListener:w});return S.event}e.fromNodeEventEmitter=I;function f(k,b,P=O=>O){let O=(...z)=>S.fire(P(...z)),D=()=>k.addEventListener(b,O),w=()=>k.removeEventListener(b,O),S=new T({onWillAddFirstListener:D,onDidRemoveLastListener:w});return S.event}e.fromDOMEventEmitter=f;function L(k){return new Promise(b=>i(k)(b))}e.toPromise=L;function B(k){let b=new T;return k.then(P=>{b.fire(P)},()=>{b.fire(void 0)}).finally(()=>{b.dispose()}),b.event}e.fromPromise=B;function U(k,b){return k(P=>b.fire(P))}e.forward=U;function V(k,b,P){return b(P),k(O=>b(O))}e.runAndSubscribe=V;class F{constructor(b,P){this._observable=b,this._counter=0,this._hasChanged=!1;let O={onWillAddFirstListener:()=>{b.addObserver(this)},onDidRemoveLastListener:()=>{b.removeObserver(this)}};this.emitter=new T(O),P&&P.add(this.emitter)}beginUpdate(b){this._counter++}handlePossibleChange(b){}handleChange(b,P){this._hasChanged=!0}endUpdate(b){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function R(k,b){return new F(k,b).emitter.event}e.fromObservable=R;function N(k){return(b,P,O)=>{let D=0,w=!1,S={beginUpdate(){D++},endUpdate(){D--,D===0&&(k.reportChanges(),w&&(w=!1,b.call(P)))},handlePossibleChange(){},handleChange(){w=!0}};k.addObserver(S),k.reportChanges();let z={dispose(){k.removeObserver(S)}};return O instanceof vt?O.add(z):Array.isArray(O)&&O.push(z),z}}e.fromObservableLight=N})(ke||={});var ks=class xs{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${xs._idPool++}`,xs.all.add(this)}start(t){this._stopWatch=new Wc,this.listenerCount=t}stop(){if(this._stopWatch){let t=this._stopWatch.elapsed();this.durations.push(t),this.elapsedOverall+=t,this.invocationCount+=1,this._stopWatch=void 0}}};ks.all=new Set,ks._idPool=0;var Uc=ks,Vc=-1,po=class go{constructor(t,i,s=(go._idPool++).toString(16).padStart(3,"0")){this._errorHandler=t,this.threshold=i,this.name=s,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(t,i){let s=this.threshold;if(s<=0||i{let n=this._stacks.get(t.value)||0;this._stacks.set(t.value,n-1)}}getMostFrequentStack(){if(!this._stacks)return;let t,i=0;for(let[s,r]of this._stacks)(!t||i{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let a=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new Gc(`${o}. HINT: Stack shows most frequent listener (${a[1]}-times)`,a[0]);return(this._options?.onListenerError||Ei)(h),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));let s=new Zi(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=jc.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Zi?(this._deliveryQueue??=new ed,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=ne(()=>{r?.(),this._removeListener(s)});return i instanceof vt?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*Jc<=t.length){let r=0;for(let n=0;n0}},ed=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Es=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new T,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new T,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Es.INSTANCE=new Es;var dr=Es;function td(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}dr.INSTANCE.onDidChangeZoomLevel;function id(e){return dr.INSTANCE.getZoomFactor(e)}dr.INSTANCE.onDidChangeFullscreen;var zt=typeof navigator=="object"?navigator.userAgent:"",Bs=zt.indexOf("Firefox")>=0,sd=zt.indexOf("AppleWebKit")>=0,ur=zt.indexOf("Chrome")>=0,rd=!ur&&zt.indexOf("Safari")>=0;zt.indexOf("Electron/")>=0;zt.indexOf("Android")>=0;var Ji=!1;if(typeof st.matchMedia=="function"){let e=st.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=st.matchMedia("(display-mode: fullscreen)");Ji=e.matches,td(st,e,({matches:i})=>{Ji&&t.matches||(Ji=i)})}var At="en",Ds=!1,Ms=!1,Bi=!1,go=!1,pi,Di=At,Ar=At,nd,tt,Et=globalThis,He;typeof Et.vscode<"u"&&typeof Et.vscode.process<"u"?He=Et.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(He=process);var od=typeof He?.versions?.electron=="string",ad=od&&He?.type==="renderer";if(typeof He=="object"){Ds=He.platform==="win32",Ms=He.platform==="darwin",Bi=He.platform==="linux",Bi&&He.env.SNAP&&He.env.SNAP_REVISION,He.env.CI||He.env.BUILD_ARTIFACTSTAGINGDIRECTORY,pi=At,Di=At;let e=He.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);pi=t.userLocale,Ar=t.osLocale,Di=t.resolvedLanguage||At,nd=t.languagePack?.translationsConfigFile}catch{}go=!0}else typeof navigator=="object"&&!ad?(tt=navigator.userAgent,Ds=tt.indexOf("Windows")>=0,Ms=tt.indexOf("Macintosh")>=0,(tt.indexOf("Macintosh")>=0||tt.indexOf("iPad")>=0||tt.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Bi=tt.indexOf("Linux")>=0,tt?.indexOf("Mobi")>=0,Di=globalThis._VSCODE_NLS_LANGUAGE||At,pi=navigator.language.toLowerCase(),Ar=pi):console.error("Unable to resolve platform.");var vo=Ds,Ze=Ms,ld=Bi,Ir=go,Je=tt,dt=Di,hd;(e=>{function t(){return dt}e.value=t;function i(){return dt.length===2?dt==="en":dt.length>=3?dt[0]==="e"&&dt[1]==="n"&&dt[2]==="-":!1}e.isDefaultVariant=i;function s(){return dt==="en"}e.isDefault=s})(hd||={});var cd=typeof Et.postMessage=="function"&&!Et.importScripts;(()=>{if(cd){let e=[];Et.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s{let s=++t;e.push({id:s,callback:i}),Et.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var dd=!!(Je&&Je.indexOf("Chrome")>=0);Je&&Je.indexOf("Firefox")>=0;!dd&&Je&&Je.indexOf("Safari")>=0;Je&&Je.indexOf("Edg/")>=0;Je&&Je.indexOf("Android")>=0;var Pt=typeof navigator=="object"?navigator:{};Ir||document.queryCommandSupported&&document.queryCommandSupported("copy")||Pt&&Pt.clipboard&&Pt.clipboard.writeText,Ir||Pt&&Pt.clipboard&&Pt.clipboard.readText;var _r=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Qi=new _r,Nr=new _r,Or=new _r,ud=new Array(230),mo;(e=>{function t(a){return Qi.keyCodeToStr(a)}e.toString=t;function i(a){return Qi.strToKeyCode(a)}e.fromString=i;function s(a){return Nr.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return Or.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return Nr.strToKeyCode(a)||Or.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Qi.keyCodeToStr(a)}e.toElectronAccelerator=o})(mo||={});var _d=class bo{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof bo&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new fd([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},fd=class{constructor(e){if(e.length===0)throw Hc("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t{function t(i){return i===e.None||i===e.Cancelled||i instanceof Cd?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ke.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:So})})(yd||={});var Cd=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?So:(this._emitter||(this._emitter=new T),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},fr=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new ws("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new ws("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},kd=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new ws("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=ne(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},xd;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(xd||={});var zr=class We{static fromArray(t){return new We(i=>{i.emitMany(t)})}static fromPromise(t){return new We(async i=>{i.emitMany(await t)})}static fromPromises(t){return new We(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new We(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new T,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new We(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return We.map(this,t)}static filter(t,i){return new We(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return We.filter(this,t)}static coalesce(t){return We.filter(t,i=>!!i)}coalesce(){return We.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return We.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};zr.EMPTY=zr.fromArray([]);var{getWindow:Ge,getWindowId:Ed,onDidRegisterWindow:Bd}=(function(){let e=new Map,t={window:st,disposables:new vt};e.set(st.vscodeWindowId,t);let i=new T,s=new T,r=new T;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return G.None;let a=new vt,h={window:o,disposables:a.add(new vt)};return e.set(o.vscodeWindowId,h),a.add(ne(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(V(o,be.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(h),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let h=o;return h?.view?h.view.window:st},getDocument(o){return Ge(o).document}}})(),Dd=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function V(e,t,i,s){return new Dd(e,t,i,s)}var Wr=function(e,t,i,s){return V(e,t,i,s)},pr,Md=class extends kd{constructor(e){super(),this.defaultTarget=e&&Ge(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Ur=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ei(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort(Ur.sort),o.shift().execute();s.set(n,!1)};pr=(n,o,a=0)=>{let h=Ed(n),l=new Ur(o,a),d=e.get(h);return d||(d=[],e.set(h,d)),d.push(l),i.get(h)||(i.set(h,!0),n.requestAnimationFrame(()=>r(h))),l}})();function Rd(e){let t=e.getBoundingClientRect(),i=Ge(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var be={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Ld=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Ae(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ae(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ae(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ae(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ae(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ae(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ae(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ae(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ae(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ae(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ae(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ae(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ae(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ae(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ae(e){return typeof e=="number"?`${e}px`:e}function ti(e){return new Ld(e)}var wo=class{constructor(){this._hooks=new vt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(ne(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=Ge(e)}this._hooks.add(V(n,be.POINTER_MOVE,o=>{if(o.buttons!==i){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(V(n,be.POINTER_UP,o=>this.stopMonitoring(!0)))}};function Pd(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var Xe;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Xe||={});var Gt=class Ee extends G{constructor(){super(),this.dispatched=!1,this.targets=new Tr,this.ignoreTargets=new Tr,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ke.runAndSubscribe(Bd,({window:t,disposables:i})=>{i.add(V(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(V(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(V(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:st,disposables:this._store}))}static addTarget(t){if(!Ee.isTouchDevice())return G.None;Ee.INSTANCE||(Ee.INSTANCE=new Ee);let i=Ee.INSTANCE.targets.push(t);return ne(i)}static ignoreTarget(t){if(!Ee.isTouchDevice())return G.None;Ee.INSTANCE||(Ee.INSTANCE=new Ee);let i=Ee.INSTANCE.ignoreTargets.push(t);return ne(i)}static isTouchDevice(){return"ontouchstart"in st||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s=Ee.HOLD_DELAY&&Math.abs(h.initialPageX-Oe(h.rollingPageX))<30&&Math.abs(h.initialPageY-Oe(h.rollingPageY))<30){let d=this.newGestureEvent(Xe.Contextmenu,h.initialTarget);d.pageX=Oe(h.rollingPageX),d.pageY=Oe(h.rollingPageY),this.dispatchEvent(d)}else if(r===1){let d=Oe(h.rollingPageX),c=Oe(h.rollingPageY),u=Oe(h.rollingTimestamps)-h.rollingTimestamps[0],v=d-h.rollingPageX[0],_=c-h.rollingPageY[0],m=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,m,s,Math.abs(v)/u,v>0?1:-1,d,Math.abs(_)/u,_>0?1:-1,c)}this.dispatchEvent(this.newGestureEvent(Xe.End,h.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===Xe.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Ee.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===Xe.Change||t.type===Xe.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,o,a,h,l){this.handle=pr(t,()=>{let d=Date.now(),c=d-s,u=0,v=0,_=!0;r+=Ee.SCROLL_FRICTION*c,a+=Ee.SCROLL_FRICTION*c,r>0&&(_=!1,u=n*r*c),a>0&&(_=!1,v=h*a*c);let m=this.newGestureEvent(Xe.Change);m.translationX=u,m.translationY=v,i.forEach(C=>C.dispatchEvent(m)),_||this.inertia(t,i,d,r,n,o+u,a,h,l+v)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Gt.SCROLL_FRICTION=-.005,Gt.HOLD_DELAY=700,Gt.CLEAR_TAP_COUNT_TIME=400,he([Pd],Gt,"isTouchDevice",1);var Td=Gt,gr=class extends G{onclick(e,t){this._register(V(e,be.CLICK,i=>t(new gi(Ge(e),i))))}onmousedown(e,t){this._register(V(e,be.MOUSE_DOWN,i=>t(new gi(Ge(e),i))))}onmouseover(e,t){this._register(V(e,be.MOUSE_OVER,i=>t(new gi(Ge(e),i))))}onmouseleave(e,t){this._register(V(e,be.MOUSE_LEAVE,i=>t(new gi(Ge(e),i))))}onkeydown(e,t){this._register(V(e,be.KEY_DOWN,i=>t(new $r(i))))}onkeyup(e,t){this._register(V(e,be.KEY_UP,i=>t(new $r(i))))}oninput(e,t){this._register(V(e,be.INPUT,t))}onblur(e,t){this._register(V(e,be.BLUR,t))}onfocus(e,t){this._register(V(e,be.FOCUS,t))}onchange(e,t){this._register(V(e,be.CHANGE,t))}ignoreGesture(e){return Td.ignoreTarget(e)}},Vr=11,Ad=class extends gr{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=Vr+"px",this.domNode.style.height=Vr+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new wo),this._register(Wr(this.bgDomNode,be.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Wr(this.domNode,be.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Md),this._pointerdownScheduleRepeatTimer=this._register(new fr)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ge(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Id=class Rs{constructor(t,i,s,r,n,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,o=o|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),a+n>o&&(a=o-n),a<0&&(a=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=o,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new Rs(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Rs(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,h=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:h}}},Nd=class extends G{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Id(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new qr(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=qr.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Kr=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function es(e,t){let i=t-e;return function(s){return e+i*Hd(s)}}function Od(e,t,i){return function(s){return s2.5*s){let r,n;return t{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},zd=140,yo=class extends gr{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new Fd(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new wo),this._shouldRender=!0,this.domNode=ti(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(V(this.domNode.domNode,be.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Ad(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ti(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(V(this.slider.domNode,be.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=Rd(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),o=Math.abs(n-i);if(vo&&o>zd){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let a=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},Co=class Ps{constructor(t,i,s,r,n,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ps(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let o=Math.max(0,s-t),a=Math.max(0,o-2*i),h=r>0&&r>s;if(!h)return{computedAvailableSize:Math.round(o),computedIsNeeded:h,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let l=Math.round(Math.max(20,Math.floor(s*a/r))),d=(a-l)/(r-s),c=n*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:h,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){let t=Ps._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o=Math.abs(i.deltaX),a=Math.abs(i.deltaY),h=Math.max(Math.min(r,o),1),l=Math.max(Math.min(n,a),1),d=Math.max(r,o),c=Math.max(n,a);d%h===0&&c%l===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Ts.INSTANCE=new Ts;var qd=Ts,Yd=class extends gr{constructor(e,t,i){super(),this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new T),this.onWillScroll=this._onWillScroll.event,this._options=Xd(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new Ud(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Wd(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ti(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ti(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ti(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new fr),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Mt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Ze&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Fr(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Mt(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new Fr(i))};this._mouseWheelToDispose.push(V(this._listenOnDomNode,be.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=qd.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let o=!Ze&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!n&&(n=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),h={};if(r){let l=Yr*r,d=a.scrollTop-(l<0?Math.floor(l):Math.ceil(l));this._verticalScrollbar.writeScrollPosition(h,d)}if(n){let l=Yr*n,d=a.scrollLeft-(l<0?Math.floor(l):Math.ceil(l));this._horizontalScrollbar.writeScrollPosition(h,d)}h=this._scrollable.validateScrollPosition(h),(a.scrollLeft!==h.scrollLeft||a.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Vd)}},jd=class extends Yd{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Xd(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Ze&&(t.className+=" mac"),t}var As=class extends G{constructor(e,t,i,s,r,n,o,a){super(),this._bufferService=i,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new T),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new Nd({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:l=>pr(s.window,l)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new jd(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(l=>{this._scrollableElement.updateOptions({handleMouseWheel:!(l&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ke.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ne(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ne(()=>this._styleElement.remove())),this._register(ke.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` -`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(l=>this._handleScroll(l)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};As=he([$(2,Le),$(3,at),$(4,io),$(5,Ft),$(6,Pe),$(7,lt)],As);var Is=class extends G{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this._register(ne(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Is=he([$(1,Le),$(2,at),$(3,li),$(4,lt)],Is);var Gd=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Ye={full:0,left:0,center:0,right:0},ut={full:0,left:0,center:0,right:0},Ut={full:0,left:0,center:0,right:0},Ii=class extends G{constructor(e,t,i,s,r,n,o,a){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=n,this._themeService=o,this._coreBrowserService=a,this._colorZoneStore=new Gd,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(ne(()=>this._canvas?.remove()));let h=this._canvas.getContext("2d");if(h)this._ctx=h;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);ut.full=this._canvas.width,ut.left=e,ut.center=t,ut.right=e,this._refreshDrawHeightConstants(),Ut.full=1,Ut.left=1,Ut.center=1+ut.left,Ut.right=1+ut.left+ut.center}_refreshDrawHeightConstants(){Ye.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ye.left=t,Ye.center=t,Ye.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ut[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ye[e.position||"full"]/2),ut[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ye[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ii=he([$(2,Le),$(3,li),$(4,lt),$(5,Pe),$(6,Ft),$(7,at)],Ii);var y;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=` -`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(y||={});var Mi;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(Mi||={});var ko;(e=>e.ST=`${y.ESC}\\`)(ko||={});var Ns=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.lengththis.updateCompositionElements(!0),0)}}};Ns=he([$(2,Le),$(3,Pe),$(4,Lt),$(5,lt)],Ns);var Se=0,we=0,ye=0,le=0,jr={css:"#00000000",rgba:0},_e;(e=>{function t(r,n,o,a){return a!==void 0?`#${bt(r)}${bt(n)}${bt(o)}${bt(a)}`:`#${bt(r)}${bt(n)}${bt(o)}`}e.toCss=t;function i(r,n,o,a=255){return(r<<24|n<<16|o<<8|a)>>>0}e.toRgba=i;function s(r,n,o,a){return{css:e.toCss(r,n,o,a),rgba:e.toRgba(r,n,o,a)}}e.toColor=s})(_e||={});var re;(e=>{function t(h,l){if(le=(l.rgba&255)/255,le===1)return{css:l.css,rgba:l.rgba};let d=l.rgba>>24&255,c=l.rgba>>16&255,u=l.rgba>>8&255,v=h.rgba>>24&255,_=h.rgba>>16&255,m=h.rgba>>8&255;Se=v+Math.round((d-v)*le),we=_+Math.round((c-_)*le),ye=m+Math.round((u-m)*le);let C=_e.toCss(Se,we,ye),M=_e.toRgba(Se,we,ye);return{css:C,rgba:M}}e.blend=t;function i(h){return(h.rgba&255)===255}e.isOpaque=i;function s(h,l,d){let c=Ri.ensureContrastRatio(h.rgba,l.rgba,d);if(c)return _e.toColor(c>>24&255,c>>16&255,c>>8&255)}e.ensureContrastRatio=s;function r(h){let l=(h.rgba|255)>>>0;return[Se,we,ye]=Ri.toChannels(l),{css:_e.toCss(Se,we,ye),rgba:l}}e.opaque=r;function n(h,l){return le=Math.round(l*255),[Se,we,ye]=Ri.toChannels(h.rgba),{css:_e.toCss(Se,we,ye,le),rgba:_e.toRgba(Se,we,ye,le)}}e.opacity=n;function o(h,l){return le=h.rgba&255,n(h,le*l/255)}e.multiplyOpacity=o;function a(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=a})(re||={});var ae;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Se=parseInt(r.slice(1,2).repeat(2),16),we=parseInt(r.slice(2,3).repeat(2),16),ye=parseInt(r.slice(3,4).repeat(2),16),_e.toColor(Se,we,ye);case 5:return Se=parseInt(r.slice(1,2).repeat(2),16),we=parseInt(r.slice(2,3).repeat(2),16),ye=parseInt(r.slice(3,4).repeat(2),16),le=parseInt(r.slice(4,5).repeat(2),16),_e.toColor(Se,we,ye,le);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return Se=parseInt(n[1]),we=parseInt(n[2]),ye=parseInt(n[3]),le=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),_e.toColor(Se,we,ye,le);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Se,we,ye,le]=t.getImageData(0,0,1,1).data,le!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_e.toRgba(Se,we,ye,le),css:r}}e.toColor=s})(ae||={});var Me;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let o=s/255,a=r/255,h=n/255,l=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),c=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return l*.2126+d*.7152+c*.0722}e.relativeLuminance2=i})(Me||={});var Ri;(e=>{function t(o,a){if(le=(a&255)/255,le===1)return a;let h=a>>24&255,l=a>>16&255,d=a>>8&255,c=o>>24&255,u=o>>16&255,v=o>>8&255;return Se=c+Math.round((h-c)*le),we=u+Math.round((l-u)*le),ye=v+Math.round((d-v)*le),_e.toRgba(Se,we,ye)}e.blend=t;function i(o,a,h){let l=Me.relativeLuminance(o>>8),d=Me.relativeLuminance(a>>8);if(et(l,d)>8));if(_>8));return _>C?v:m}return v}let c=r(o,a,h),u=et(l,Me.relativeLuminance(c>>8));if(u>8));return u>_?c:v}return c}}e.ensureContrastRatio=i;function s(o,a,h){let l=o>>24&255,d=o>>16&255,c=o>>8&255,u=a>>24&255,v=a>>16&255,_=a>>8&255,m=et(Me.relativeLuminance2(u,v,_),Me.relativeLuminance2(l,d,c));for(;m0||v>0||_>0);)u-=Math.max(0,Math.ceil(u*.1)),v-=Math.max(0,Math.ceil(v*.1)),_-=Math.max(0,Math.ceil(_*.1)),m=et(Me.relativeLuminance2(u,v,_),Me.relativeLuminance2(l,d,c));return(u<<24|v<<16|_<<8|255)>>>0}e.reduceLuminance=s;function r(o,a,h){let l=o>>24&255,d=o>>16&255,c=o>>8&255,u=a>>24&255,v=a>>16&255,_=a>>8&255,m=et(Me.relativeLuminance2(u,v,_),Me.relativeLuminance2(l,d,c));for(;m>>0}e.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(Ri||={});function bt(e){let t=e.toString(16);return t.length<2?"0"+t:t}function et(e,t){return e1){let d=this._getJoinedRanges(s,o,n,t,r);for(let c=0;c1){let l=this._getJoinedRanges(s,o,n,t,r);for(let d=0;d=I,w=b,S=this._workCell;if(u.length>0&&b===u[0][0]&&D){let ee=u.shift(),qi=this._isCellInSelection(ee[0],t);for(F=ee[0]+1;F=ee[1],D?(O=!0,S=new Zd(this._workCell,e.translateToString(!0,ee[0],ee[1]),ee[1]-ee[0]),w=ee[1]-1,P=S.getWidth()):I=ee[1]}let z=this._isCellInSelection(b,t),Z=i&&b===n,se=k&&b>=l&&b<=d,xe=!1;this._decorationService.forEachDecorationAtCell(b,t,void 0,ee=>{xe=!0});let De=S.getChars()||pt;if(De===" "&&(S.isUnderline()||S.isOverline())&&(De=" "),K=P*a-h.get(De,S.isBold(),S.isItalic()),!m)m=this._document.createElement("span");else if(C&&(z&&L||!z&&!L&&S.bg===N)&&(z&&L&&v.selectionForeground||S.fg===f)&&S.extended.ext===R&&se===B&&K===U&&!Z&&!O&&!xe&&D){S.isInvisible()?M+=pt:M+=De,C++;continue}else C&&(m.textContent=M),m=this._document.createElement("span"),C=0,M="";if(N=S.bg,f=S.fg,R=S.extended.ext,B=se,U=K,L=z,O&&n>=b&&n<=w&&(n=b),!this._coreService.isCursorHidden&&Z&&this._coreService.isCursorInitialized){if(H.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&H.push("xterm-cursor-blink"),H.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":H.push("xterm-cursor-outline");break;case"block":H.push("xterm-cursor-block");break;case"bar":H.push("xterm-cursor-bar");break;case"underline":H.push("xterm-cursor-underline");break}}if(S.isBold()&&H.push("xterm-bold"),S.isItalic()&&H.push("xterm-italic"),S.isDim()&&H.push("xterm-dim"),S.isInvisible()?M=pt:M=S.getChars()||pt,S.isUnderline()&&(H.push(`xterm-underline-${S.extended.underlineStyle}`),M===" "&&(M=" "),!S.isUnderlineColorDefault()))if(S.isUnderlineColorRGB())m.style.textDecorationColor=`rgb(${ai.toColorRGB(S.getUnderlineColor()).join(",")})`;else{let ee=S.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&S.isBold()&&ee<8&&(ee+=8),m.style.textDecorationColor=v.ansi[ee].css}S.isOverline()&&(H.push("xterm-overline"),M===" "&&(M=" ")),S.isStrikethrough()&&H.push("xterm-strikethrough"),se&&(m.style.textDecoration="underline");let Te=S.getFgColor(),qe=S.getFgColorMode(),Fe=S.getBgColor(),mt=S.getBgColorMode(),Ki=!!S.isInverse();if(Ki){let ee=Te;Te=Fe,Fe=ee;let qi=qe;qe=mt,mt=qi}let ht,di,Wt=!1;this._decorationService.forEachDecorationAtCell(b,t,void 0,ee=>{ee.options.layer!=="top"&&Wt||(ee.backgroundColorRGB&&(mt=50331648,Fe=ee.backgroundColorRGB.rgba>>8&16777215,ht=ee.backgroundColorRGB),ee.foregroundColorRGB&&(qe=50331648,Te=ee.foregroundColorRGB.rgba>>8&16777215,di=ee.foregroundColorRGB),Wt=ee.options.layer==="top")}),!Wt&&z&&(ht=this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque,Fe=ht.rgba>>8&16777215,mt=50331648,Wt=!0,v.selectionForeground&&(qe=50331648,Te=v.selectionForeground.rgba>>8&16777215,di=v.selectionForeground)),Wt&&H.push("xterm-decoration-top");let ct;switch(mt){case 16777216:case 33554432:ct=v.ansi[Fe],H.push(`xterm-bg-${Fe}`);break;case 50331648:ct=_e.toColor(Fe>>16,Fe>>8&255,Fe&255),this._addStyle(m,`background-color:#${Xr((Fe>>>0).toString(16),"0",6)}`);break;default:Ki?(ct=v.foreground,H.push("xterm-bg-257")):ct=v.background}switch(ht||S.isDim()&&(ht=re.multiplyOpacity(ct,.5)),qe){case 16777216:case 33554432:S.isBold()&&Te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Te+=8),this._applyMinimumContrast(m,ct,v.ansi[Te],S,ht,void 0)||H.push(`xterm-fg-${Te}`);break;case 50331648:let ee=_e.toColor(Te>>16&255,Te>>8&255,Te&255);this._applyMinimumContrast(m,ct,ee,S,ht,di)||this._addStyle(m,`color:#${Xr(Te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(m,ct,v.foreground,S,ht,di)||Ki&&H.push("xterm-fg-257")}H.length&&(m.className=H.join(" "),H.length=0),!Z&&!O&&!xe&&D?C++:m.textContent=M,K!==this.defaultSpacing&&(m.style.letterSpacing=`${K}px`),c.push(m),b=w}return m&&C&&(m.textContent=M),c}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||eu(s.getCode()))return!1;let o=this._getContrastCache(s),a;if(!r&&!n&&(a=o.getColor(t.rgba,i.rgba)),a===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=re.ensureContrastRatio(r||t,n||i,h),o.setColor((r||t).rgba,(n||i).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t=i[0]&&e=i[0]}};Os=he([$(1,no),$(2,Pe),$(3,at),$(4,Lt),$(5,li),$(6,Ft)],Os);function Xr(e,t,i){for(;e.length0&&(this._flat[s]=o),o}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let o=0;t&&(o|=1),i&&(o|=2),n=this._measure(e,o),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},su=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),h=Math.min(o,e.rows-1);if(a>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&t=this.startCol):!1}};function ru(){return new su}var ts="xterm-dom-renderer-owner-",ze="xterm-rows",mi="xterm-fg-",Gr="xterm-bg-",Vt="xterm-focus",bi="xterm-selection",nu=1,$s=class extends G{constructor(e,t,i,s,r,n,o,a,h,l,d,c,u,v){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=o,this._charSizeService=h,this._optionsService=l,this._bufferService=d,this._coreService=c,this._coreBrowserService=u,this._themeService=v,this._terminalClass=nu++,this._rowElements=[],this._selectionRenderModel=ru(),this.onRequestRedraw=this._register(new T).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ze),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(bi),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=tu(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(_=>this._injectCss(_))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(Os,document),this._element.classList.add(ts+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(_=>this._handleLinkHover(_))),this._register(this._linkifier2.onHideLinkUnderline(_=>this._handleLinkLeave(_))),this._register(ne(()=>{this._element.classList.remove(ts+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new iu(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${ze} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${ze} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${ze} .xterm-dim { color: ${re.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${ze}.${Vt} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${ze}.${Vt} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${ze}.${Vt} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${bi} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${bi} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${bi} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,o]of e.ansi.entries())t+=`${this._terminalSelector} .${mi}${n} { color: ${o.css}; }${this._terminalSelector} .${mi}${n}.xterm-dim { color: ${re.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${Gr}${n} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${mi}257 { color: ${re.opaque(e.background).css}; }${this._terminalSelector} .${mi}257.xterm-dim { color: ${re.multiplyOpacity(re.opaque(e.background),.5).css}; }${this._terminalSelector} .${Gr}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Vt),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Vt),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){let h=e[0]>t[0];a.appendChild(this._createSelectionElement(n,h?t[0]:e[0],h?e[0]:t[0],o-n+1))}else{let h=s===n?e[0]:0,l=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,h,l));let d=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,d)),n!==o){let c=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,c))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(i-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${o}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let l=h+i.ydisp,d=this._rowElements[h],c=i.lines.get(l);if(!d||!c)break;d.replaceChildren(...this._rowFactory.createRow(c,l,l===s,o,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${ts}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let o=this._bufferService.rows-1;i=Math.max(Math.min(i,o),0),s=Math.max(Math.min(s,o),0),r=Math.min(r,this._bufferService.cols);let a=this._bufferService.buffer,h=a.ybase+a.y,l=Math.min(a.x,r-1),d=this._optionsService.rawOptions.cursorBlink,c=this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=i;v<=s;++v){let _=v+a.ydisp,m=this._rowElements[v],C=a.lines.get(_);if(!m||!C)break;m.replaceChildren(...this._rowFactory.createRow(C,_,_===h,c,u,l,d,this.dimensions.css.cell.width,this._widthCache,n?v===i?e:0:-1,n?(v===s?t:r)-1:-1))}}};$s=he([$(7,hr),$(8,Wi),$(9,Pe),$(10,Le),$(11,Lt),$(12,at),$(13,Ft)],$s);var Hs=class extends G{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new T),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new au(this._optionsService))}catch{this._measureStrategy=this._register(new ou(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Hs=he([$(2,Pe)],Hs);var xo=class extends G{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},ou=class extends xo{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},au=class extends xo{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},lu=class extends G{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new hu(this._window)),this._onDprChange=this._register(new T),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new T),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(ke.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(V(this._textarea,"focus",()=>this._isFocused=!0)),this._register(V(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},hu=class extends G{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Nt),this._onDprChange=this._register(new T),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ne(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=V(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},cu=class extends G{constructor(){super(),this.linkProviders=[],this._register(ne(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function vr(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}function du(e,t,i,s,r,n,o,a,h){if(!n)return;let l=vr(e,t,i);if(l)return l[0]=Math.ceil((l[0]+(h?o/2:0))/o),l[1]=Math.ceil(l[1]/a),l[0]=Math.min(Math.max(l[0],1),s+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),r),l}var Fs=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return du(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=vr(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};Fs=he([$(0,lt),$(1,Wi)],Fs);var uu=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Eo={};yc(Eo,{getSafariVersion:()=>fu,isChromeOS:()=>Ro,isFirefox:()=>Bo,isIpad:()=>pu,isIphone:()=>gu,isLegacyEdge:()=>_u,isLinux:()=>mr,isMac:()=>Oi,isNode:()=>Ui,isSafari:()=>Do,isWindows:()=>Mo});var Ui=typeof process<"u"&&"title"in process,hi=Ui?"node":navigator.userAgent,ci=Ui?"node":navigator.platform,Bo=hi.includes("Firefox"),_u=hi.includes("Edge"),Do=/^((?!chrome|android).)*safari/i.test(hi);function fu(){if(!Do)return 0;let e=hi.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Oi=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ci),pu=ci==="iPad",gu=ci==="iPhone",Mo=["Windows","Win16","Win32","WinCE"].includes(ci),mr=ci.indexOf("Linux")>=0,Ro=/\bCrOS\b/.test(hi),Lo=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ir){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},vu=class extends Lo{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},mu=class extends Lo{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},$i=!Ui&&"requestIdleCallback"in window?mu:vu,bu=class{constructor(){this._queue=new $i}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},zs=class extends G{constructor(e,t,i,s,r,n,o,a,h){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=a,this._renderer=this._register(new Nt),this._pausedResizeTask=new bu,this._observerDisposable=this._register(new Nt),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new T),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new T),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new T),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new T),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new uu((l,d)=>this._renderRows(l,d),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new Su(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ne(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(l=>this._registerIntersectionObserver(l,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=ne(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};zs=he([$(2,Pe),$(3,Wi),$(4,Lt),$(5,li),$(6,Le),$(7,at),$(8,Ft)],zs);var Su=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function wu(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return ku(r,n,e,t,i,s)+Vi(n,t,i,s)+xu(r,n,e,t,i,s);let o;if(n===t)return o=r>e?"D":"C",ni(Math.abs(r-e),ri(o,s));o=n>t?"D":"C";let a=Math.abs(n-t),h=Cu(n>t?e:r,i)+(a-1)*i.cols+1+yu(n>t?r:e);return ni(h,ri(o,s))}function yu(e,t){return e-1}function Cu(e,t){return t.cols-e}function ku(e,t,i,s,r,n){return Vi(t,s,r,n).length===0?"":ni(To(e,t,e,t-Rt(t,r),!1,r).length,ri("D",n))}function Vi(e,t,i,s){let r=e-Rt(e,i),n=t-Rt(t,i),o=Math.abs(r-n)-Eu(e,t,i);return ni(o,ri(Po(e,t),s))}function xu(e,t,i,s,r,n){let o;Vi(t,s,r,n).length>0?o=s-Rt(s,r):o=t;let a=s,h=Bu(e,t,i,s,r,n);return ni(To(e,o,i,a,h==="C",r).length,ri(h,n))}function Eu(e,t,i){let s=0,r=e-Rt(e,i),n=t-Rt(t,i);for(let o=0;o=0&&e0?o=s-Rt(s,r):o=t,e=i&&ot?"A":"B"}function To(e,t,i,s,r,n){let o=e,a=t,h="";for(;(o!==i||a!==s)&&a>=0&&an.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function ri(e,t){let i=t?"O":"[";return y.ESC+i+e}function ni(e,t){e=Math.floor(e);let i="";for(let s=0;sthis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Zr(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var is=50,Mu=15,Ru=50,Lu=500,Pu=" ",Tu=new RegExp(Pu,"g"),Ws=class extends G{constructor(e,t,i,s,r,n,o,a,h){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ve,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new T),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new T),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new T),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new T),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=l=>this._handleMouseMove(l),this._mouseUpListener=l=>this._handleMouseUp(l),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(l=>this._handleTrim(l)),this._register(this._bufferService.buffers.onBufferActivate(l=>this._handleBufferActivate(l))),this.enable(),this._model=new Du(this._bufferService),this._activeSelectionMode=0,this._register(ne(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(l=>{l.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]r.replace(Tu," ")).join(Mo?`\r +`))}},Yc=class extends Error{constructor(e,t){super(e),this.name="ListenerLeakError",this.stack=t}},jc=class extends Error{constructor(e,t){super(e),this.name="ListenerRefusalError",this.stack=t}},Xc=0,Zi=class{constructor(e){this.value=e,this.id=Xc++}},Gc=2,Zc,T=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new Kc(e?.onListenerError??Ei,this._options?.leakWarningThreshold??Vc):void 0,this._perfMon=this._options?._profName?new Uc(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,i)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let o=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(o);let a=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new jc(`${o}. HINT: Stack shows most frequent listener (${a[1]}-times)`,a[0]);return(this._options?.onListenerError||Ei)(h),G.None}if(this._disposed)return G.None;t&&(e=e.bind(t));let s=new Zi(e),r;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(s.stack=qc.create(),r=this._leakageMon.check(s.stack,this._size+1)),this._listeners?this._listeners instanceof Zi?(this._deliveryQueue??=new Jc,this._listeners=[this._listeners,s]):this._listeners.push(s):(this._options?.onWillAddFirstListener?.(this),this._listeners=s,this._options?.onDidAddFirstListener?.(this)),this._size++;let n=ne(()=>{r?.(),this._removeListener(s)});return i instanceof vt?i.add(n):Array.isArray(i)&&i.push(n),n},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,i=t.indexOf(e);if(i===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,t[i]=void 0;let s=this._deliveryQueue.current===this;if(this._size*Gc<=t.length){let r=0;for(let n=0;n0}},Jc=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,i){this.i=0,this.end=i,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},Es=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new T,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new T,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(t){return this.mapWindowIdToZoomLevel.get(this.getWindowId(t))??0}setZoomLevel(t,i){if(this.getZoomLevel(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToZoomLevel.set(s,t),this._onDidChangeZoomLevel.fire(s)}getZoomFactor(t){return this.mapWindowIdToZoomFactor.get(this.getWindowId(t))??1}setZoomFactor(t,i){this.mapWindowIdToZoomFactor.set(this.getWindowId(i),t)}setFullscreen(t,i){if(this.isFullscreen(i)===t)return;let s=this.getWindowId(i);this.mapWindowIdToFullScreen.set(s,t),this._onDidChangeFullscreen.fire(s)}isFullscreen(t){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(t))}getWindowId(t){return t.vscodeWindowId}};Es.INSTANCE=new Es;var _r=Es;function Qc(e,t,i){typeof t=="string"&&(t=e.matchMedia(t)),t.addEventListener("change",i)}_r.INSTANCE.onDidChangeZoomLevel;function ed(e){return _r.INSTANCE.getZoomFactor(e)}_r.INSTANCE.onDidChangeFullscreen;var zt=typeof navigator=="object"?navigator.userAgent:"",Bs=zt.indexOf("Firefox")>=0,td=zt.indexOf("AppleWebKit")>=0,fr=zt.indexOf("Chrome")>=0,id=!fr&&zt.indexOf("Safari")>=0;zt.indexOf("Electron/")>=0;zt.indexOf("Android")>=0;var Ji=!1;if(typeof rt.matchMedia=="function"){let e=rt.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),t=rt.matchMedia("(display-mode: fullscreen)");Ji=e.matches,Qc(rt,e,({matches:i})=>{Ji&&t.matches||(Ji=i)})}var At="en",Ds=!1,Ms=!1,Bi=!1,mo=!1,pi,Di=At,Nr=At,sd,it,Et=globalThis,He;typeof Et.vscode<"u"&&typeof Et.vscode.process<"u"?He=Et.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(He=process);var rd=typeof He?.versions?.electron=="string",nd=rd&&He?.type==="renderer";if(typeof He=="object"){Ds=He.platform==="win32",Ms=He.platform==="darwin",Bi=He.platform==="linux",Bi&&He.env.SNAP&&He.env.SNAP_REVISION,He.env.CI||He.env.BUILD_ARTIFACTSTAGINGDIRECTORY,pi=At,Di=At;let e=He.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);pi=t.userLocale,Nr=t.osLocale,Di=t.resolvedLanguage||At,sd=t.languagePack?.translationsConfigFile}catch{}mo=!0}else typeof navigator=="object"&&!nd?(it=navigator.userAgent,Ds=it.indexOf("Windows")>=0,Ms=it.indexOf("Macintosh")>=0,(it.indexOf("Macintosh")>=0||it.indexOf("iPad")>=0||it.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Bi=it.indexOf("Linux")>=0,it?.indexOf("Mobi")>=0,Di=globalThis._VSCODE_NLS_LANGUAGE||At,pi=navigator.language.toLowerCase(),Nr=pi):console.error("Unable to resolve platform.");var bo=Ds,Je=Ms,od=Bi,Or=mo,Qe=it,dt=Di,ad;(e=>{function t(){return dt}e.value=t;function i(){return dt.length===2?dt==="en":dt.length>=3?dt[0]==="e"&&dt[1]==="n"&&dt[2]==="-":!1}e.isDefaultVariant=i;function s(){return dt==="en"}e.isDefault=s})(ad||={});var ld=typeof Et.postMessage=="function"&&!Et.importScripts;(()=>{if(ld){let e=[];Et.addEventListener("message",i=>{if(i.data&&i.data.vscodeScheduleAsyncWork)for(let s=0,r=e.length;s{let s=++t;e.push({id:s,callback:i}),Et.postMessage({vscodeScheduleAsyncWork:s},"*")}}return e=>setTimeout(e)})();var hd=!!(Qe&&Qe.indexOf("Chrome")>=0);Qe&&Qe.indexOf("Firefox")>=0;!hd&&Qe&&Qe.indexOf("Safari")>=0;Qe&&Qe.indexOf("Edg/")>=0;Qe&&Qe.indexOf("Android")>=0;var Pt=typeof navigator=="object"?navigator:{};Or||document.queryCommandSupported&&document.queryCommandSupported("copy")||Pt&&Pt.clipboard&&Pt.clipboard.writeText,Or||Pt&&Pt.clipboard&&Pt.clipboard.readText;var pr=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Qi=new pr,$r=new pr,Hr=new pr,cd=new Array(230),So;(e=>{function t(a){return Qi.keyCodeToStr(a)}e.toString=t;function i(a){return Qi.strToKeyCode(a)}e.fromString=i;function s(a){return $r.keyCodeToStr(a)}e.toUserSettingsUS=s;function r(a){return Hr.keyCodeToStr(a)}e.toUserSettingsGeneral=r;function n(a){return $r.strToKeyCode(a)||Hr.strToKeyCode(a)}e.fromUserSettings=n;function o(a){if(a>=98&&a<=113)return null;switch(a){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Qi.keyCodeToStr(a)}e.toElectronAccelerator=o})(So||={});var dd=class wo{constructor(t,i,s,r,n){this.ctrlKey=t,this.shiftKey=i,this.altKey=s,this.metaKey=r,this.keyCode=n}equals(t){return t instanceof wo&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){let t=this.ctrlKey?"1":"0",i=this.shiftKey?"1":"0",s=this.altKey?"1":"0",r=this.metaKey?"1":"0";return`K${t}${i}${s}${r}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new ud([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},ud=class{constructor(e){if(e.length===0)throw Oc("chords");this.chords=e}getHashCode(){let e="";for(let t=0,i=this.chords.length;t{function t(i){return i===e.None||i===e.Cancelled||i instanceof wd?!0:!i||typeof i!="object"?!1:typeof i.isCancellationRequested=="boolean"&&typeof i.onCancellationRequested=="function"}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:ke.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:yo})})(Sd||={});var wd=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?yo:(this._emitter||(this._emitter=new T),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},gr=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e=="function"&&typeof t=="number"&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new ws("Calling 'cancelAndSet' on a disposed TimeoutTimer");this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new ws("Calling 'setIfNotSet' on a disposed TimeoutTimer");this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},yd=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,i=globalThis){if(this.isDisposed)throw new ws("Calling 'cancelAndSet' on a disposed IntervalTimer");this.cancel();let s=i.setInterval(()=>{e()},t);this.disposable=ne(()=>{i.clearInterval(s),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}},Cd;(e=>{async function t(s){let r,n=await Promise.all(s.map(o=>o.then(a=>a,a=>{r||(r=a)})));if(typeof r<"u")throw r;return n}e.settled=t;function i(s){return new Promise(async(r,n)=>{try{await s(r,n)}catch(o){n(o)}})}e.withAsyncBody=i})(Cd||={});var Ur=class We{static fromArray(t){return new We(i=>{i.emitMany(t)})}static fromPromise(t){return new We(async i=>{i.emitMany(await t)})}static fromPromises(t){return new We(async i=>{await Promise.all(t.map(async s=>i.emitOne(await s)))})}static merge(t){return new We(async i=>{await Promise.all(t.map(async s=>{for await(let r of s)i.emitOne(r)}))})}constructor(t,i){this._state=0,this._results=[],this._error=null,this._onReturn=i,this._onStateChanged=new T,queueMicrotask(async()=>{let s={emitOne:r=>this.emitOne(r),emitMany:r=>this.emitMany(r),reject:r=>this.reject(r)};try{await Promise.resolve(t(s)),this.resolve()}catch(r){this.reject(r)}finally{s.emitOne=void 0,s.emitMany=void 0,s.reject=void 0}})}[Symbol.asyncIterator](){let t=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(t(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,i){return new We(async s=>{for await(let r of t)s.emitOne(i(r))})}map(t){return We.map(this,t)}static filter(t,i){return new We(async s=>{for await(let r of t)i(r)&&s.emitOne(r)})}filter(t){return We.filter(this,t)}static coalesce(t){return We.filter(t,i=>!!i)}coalesce(){return We.coalesce(this)}static async toPromise(t){let i=[];for await(let s of t)i.push(s);return i}toPromise(){return We.toPromise(this)}emitOne(t){this._state===0&&(this._results.push(t),this._onStateChanged.fire())}emitMany(t){this._state===0&&(this._results=this._results.concat(t),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(t){this._state===0&&(this._state=2,this._error=t,this._onStateChanged.fire())}};Ur.EMPTY=Ur.fromArray([]);var{getWindow:Ge,getWindowId:kd,onDidRegisterWindow:xd}=(function(){let e=new Map,t={window:rt,disposables:new vt};e.set(rt.vscodeWindowId,t);let i=new T,s=new T,r=new T;function n(o,a){return(typeof o=="number"?e.get(o):void 0)??(a?t:void 0)}return{onDidRegisterWindow:i.event,onWillUnregisterWindow:r.event,onDidUnregisterWindow:s.event,registerWindow(o){if(e.has(o.vscodeWindowId))return G.None;let a=new vt,h={window:o,disposables:a.add(new vt)};return e.set(o.vscodeWindowId,h),a.add(ne(()=>{e.delete(o.vscodeWindowId),s.fire(o)})),a.add(K(o,be.BEFORE_UNLOAD,()=>{r.fire(o)})),i.fire(h),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(o){return o.vscodeWindowId},hasWindow(o){return e.has(o)},getWindowById:n,getWindow(o){let a=o;if(a?.ownerDocument?.defaultView)return a.ownerDocument.defaultView.window;let h=o;return h?.view?h.view.window:rt},getDocument(o){return Ge(o).document}}})(),Ed=class{constructor(e,t,i,s){this._node=e,this._type=t,this._handler=i,this._options=s||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,this._handler=null)}};function K(e,t,i,s){return new Ed(e,t,i,s)}var Vr=function(e,t,i,s){return K(e,t,i,s)},vr,Bd=class extends yd{constructor(e){super(),this.defaultTarget=e&&Ge(e)}cancelAndSet(e,t,i){return super.cancelAndSet(e,t,i??this.defaultTarget)}},Kr=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){Ei(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,i=new Map,s=new Map,r=n=>{i.set(n,!1);let o=e.get(n)??[];for(t.set(n,o),e.set(n,[]),s.set(n,!0);o.length>0;)o.sort(Kr.sort),o.shift().execute();s.set(n,!1)};vr=(n,o,a=0)=>{let h=kd(n),l=new Kr(o,a),d=e.get(h);return d||(d=[],e.set(h,d)),d.push(l),i.get(h)||(i.set(h,!0),n.requestAnimationFrame(()=>r(h))),l}})();function Dd(e){let t=e.getBoundingClientRect(),i=Ge(e);return{left:t.left+i.scrollX,top:t.top+i.scrollY,width:t.width,height:t.height}}var be={CLICK:"click",MOUSE_DOWN:"mousedown",MOUSE_OVER:"mouseover",MOUSE_LEAVE:"mouseleave",MOUSE_WHEEL:"wheel",POINTER_UP:"pointerup",POINTER_DOWN:"pointerdown",POINTER_MOVE:"pointermove",KEY_DOWN:"keydown",KEY_UP:"keyup",BEFORE_UNLOAD:"beforeunload",CHANGE:"change",FOCUS:"focus",BLUR:"blur",INPUT:"input"},Md=class{constructor(e){this.domNode=e,this._maxWidth="",this._width="",this._height="",this._top="",this._left="",this._bottom="",this._right="",this._paddingTop="",this._paddingLeft="",this._paddingBottom="",this._paddingRight="",this._fontFamily="",this._fontWeight="",this._fontSize="",this._fontStyle="",this._fontFeatureSettings="",this._fontVariationSettings="",this._textDecoration="",this._lineHeight="",this._letterSpacing="",this._className="",this._display="",this._position="",this._visibility="",this._color="",this._backgroundColor="",this._layerHint=!1,this._contain="none",this._boxShadow=""}setMaxWidth(e){let t=Ae(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=Ae(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=Ae(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=Ae(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=Ae(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=Ae(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=Ae(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=Ae(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=Ae(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=Ae(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=Ae(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=Ae(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=Ae(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=Ae(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?"translate3d(0px, 0px, 0px)":"")}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function Ae(e){return typeof e=="number"?`${e}px`:e}function ti(e){return new Md(e)}var Co=class{constructor(){this._hooks=new vt,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let i=this._onStopCallback;this._onStopCallback=null,e&&i&&i(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,i,s,r){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=s,this._onStopCallback=r;let n=e;try{e.setPointerCapture(t),this._hooks.add(ne(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{n=Ge(e)}this._hooks.add(K(n,be.POINTER_MOVE,o=>{if(o.buttons!==i){this.stopMonitoring(!0);return}o.preventDefault(),this._pointerMoveCallback(o)})),this._hooks.add(K(n,be.POINTER_UP,o=>this.stopMonitoring(!0)))}};function Rd(e,t,i){let s=null,r=null;if(typeof i.value=="function"?(s="value",r=i.value,r.length!==0&&console.warn("Memoize should only be used in functions with zero parameters")):typeof i.get=="function"&&(s="get",r=i.get),!r)throw new Error("not supported");let n=`$memoize$${t}`;i[s]=function(...o){return this.hasOwnProperty(n)||Object.defineProperty(this,n,{configurable:!1,enumerable:!1,writable:!1,value:r.apply(this,o)}),this[n]}}var Xe;(e=>(e.Tap="-xterm-gesturetap",e.Change="-xterm-gesturechange",e.Start="-xterm-gesturestart",e.End="-xterm-gesturesend",e.Contextmenu="-xterm-gesturecontextmenu"))(Xe||={});var Gt=class Ee extends G{constructor(){super(),this.dispatched=!1,this.targets=new Ir,this.ignoreTargets=new Ir,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(ke.runAndSubscribe(xd,({window:t,disposables:i})=>{i.add(K(t.document,"touchstart",s=>this.onTouchStart(s),{passive:!1})),i.add(K(t.document,"touchend",s=>this.onTouchEnd(t,s))),i.add(K(t.document,"touchmove",s=>this.onTouchMove(s),{passive:!1}))},{window:rt,disposables:this._store}))}static addTarget(t){if(!Ee.isTouchDevice())return G.None;Ee.INSTANCE||(Ee.INSTANCE=new Ee);let i=Ee.INSTANCE.targets.push(t);return ne(i)}static ignoreTarget(t){if(!Ee.isTouchDevice())return G.None;Ee.INSTANCE||(Ee.INSTANCE=new Ee);let i=Ee.INSTANCE.ignoreTargets.push(t);return ne(i)}static isTouchDevice(){return"ontouchstart"in rt||navigator.maxTouchPoints>0}dispose(){this.handle&&(this.handle.dispose(),this.handle=null),super.dispose()}onTouchStart(t){let i=Date.now();this.handle&&(this.handle.dispose(),this.handle=null);for(let s=0,r=t.targetTouches.length;s=Ee.HOLD_DELAY&&Math.abs(h.initialPageX-Oe(h.rollingPageX))<30&&Math.abs(h.initialPageY-Oe(h.rollingPageY))<30){let d=this.newGestureEvent(Xe.Contextmenu,h.initialTarget);d.pageX=Oe(h.rollingPageX),d.pageY=Oe(h.rollingPageY),this.dispatchEvent(d)}else if(r===1){let d=Oe(h.rollingPageX),c=Oe(h.rollingPageY),u=Oe(h.rollingTimestamps)-h.rollingTimestamps[0],v=d-h.rollingPageX[0],_=c-h.rollingPageY[0],m=[...this.targets].filter(C=>h.initialTarget instanceof Node&&C.contains(h.initialTarget));this.inertia(t,m,s,Math.abs(v)/u,v>0?1:-1,d,Math.abs(_)/u,_>0?1:-1,c)}this.dispatchEvent(this.newGestureEvent(Xe.End,h.initialTarget)),delete this.activeTouches[a.identifier]}this.dispatched&&(i.preventDefault(),i.stopPropagation(),this.dispatched=!1)}newGestureEvent(t,i){let s=document.createEvent("CustomEvent");return s.initEvent(t,!1,!0),s.initialTarget=i,s.tapCount=0,s}dispatchEvent(t){if(t.type===Xe.Tap){let i=new Date().getTime(),s=0;i-this._lastSetTapCountTime>Ee.CLEAR_TAP_COUNT_TIME?s=1:s=2,this._lastSetTapCountTime=i,t.tapCount=s}else(t.type===Xe.Change||t.type===Xe.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let s of this.ignoreTargets)if(s.contains(t.initialTarget))return;let i=[];for(let s of this.targets)if(s.contains(t.initialTarget)){let r=0,n=t.initialTarget;for(;n&&n!==s;)r++,n=n.parentElement;i.push([r,s])}i.sort((s,r)=>s[0]-r[0]);for(let[s,r]of i)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,i,s,r,n,o,a,h,l){this.handle=vr(t,()=>{let d=Date.now(),c=d-s,u=0,v=0,_=!0;r+=Ee.SCROLL_FRICTION*c,a+=Ee.SCROLL_FRICTION*c,r>0&&(_=!1,u=n*r*c),a>0&&(_=!1,v=h*a*c);let m=this.newGestureEvent(Xe.Change);m.translationX=u,m.translationY=v,i.forEach(C=>C.dispatchEvent(m)),_||this.inertia(t,i,d,r,n,o+u,a,h,l+v)})}onTouchMove(t){let i=Date.now();for(let s=0,r=t.changedTouches.length;s3&&(o.rollingPageX.shift(),o.rollingPageY.shift(),o.rollingTimestamps.shift()),o.rollingPageX.push(n.pageX),o.rollingPageY.push(n.pageY),o.rollingTimestamps.push(i)}this.dispatched&&(t.preventDefault(),t.stopPropagation(),this.dispatched=!1)}};Gt.SCROLL_FRICTION=-.005,Gt.HOLD_DELAY=700,Gt.CLEAR_TAP_COUNT_TIME=400,he([Rd],Gt,"isTouchDevice",1);var Ld=Gt,mr=class extends G{onclick(e,t){this._register(K(e,be.CLICK,i=>t(new gi(Ge(e),i))))}onmousedown(e,t){this._register(K(e,be.MOUSE_DOWN,i=>t(new gi(Ge(e),i))))}onmouseover(e,t){this._register(K(e,be.MOUSE_OVER,i=>t(new gi(Ge(e),i))))}onmouseleave(e,t){this._register(K(e,be.MOUSE_LEAVE,i=>t(new gi(Ge(e),i))))}onkeydown(e,t){this._register(K(e,be.KEY_DOWN,i=>t(new Fr(i))))}onkeyup(e,t){this._register(K(e,be.KEY_UP,i=>t(new Fr(i))))}oninput(e,t){this._register(K(e,be.INPUT,t))}onblur(e,t){this._register(K(e,be.BLUR,t))}onfocus(e,t){this._register(K(e,be.FOCUS,t))}onchange(e,t){this._register(K(e,be.CHANGE,t))}ignoreGesture(e){return Ld.ignoreTarget(e)}},qr=11,Pd=class extends mr{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement("div"),this.bgDomNode.className="arrow-background",this.bgDomNode.style.position="absolute",this.bgDomNode.style.width=e.bgWidth+"px",this.bgDomNode.style.height=e.bgHeight+"px",typeof e.top<"u"&&(this.bgDomNode.style.top="0px"),typeof e.left<"u"&&(this.bgDomNode.style.left="0px"),typeof e.bottom<"u"&&(this.bgDomNode.style.bottom="0px"),typeof e.right<"u"&&(this.bgDomNode.style.right="0px"),this.domNode=document.createElement("div"),this.domNode.className=e.className,this.domNode.style.position="absolute",this.domNode.style.width=qr+"px",this.domNode.style.height=qr+"px",typeof e.top<"u"&&(this.domNode.style.top=e.top+"px"),typeof e.left<"u"&&(this.domNode.style.left=e.left+"px"),typeof e.bottom<"u"&&(this.domNode.style.bottom=e.bottom+"px"),typeof e.right<"u"&&(this.domNode.style.right=e.right+"px"),this._pointerMoveMonitor=this._register(new Co),this._register(Vr(this.bgDomNode,be.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._register(Vr(this.domNode,be.POINTER_DOWN,t=>this._arrowPointerDown(t))),this._pointerdownRepeatTimer=this._register(new Bd),this._pointerdownScheduleRepeatTimer=this._register(new gr)}_arrowPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,Ge(e))};this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(t,200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,i=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault()}},Td=class Rs{constructor(t,i,s,r,n,o,a){this._forceIntegerValues=t,this._scrollStateBrand=void 0,this._forceIntegerValues&&(i=i|0,s=s|0,r=r|0,n=n|0,o=o|0,a=a|0),this.rawScrollLeft=r,this.rawScrollTop=a,i<0&&(i=0),r+i>s&&(r=s-i),r<0&&(r=0),n<0&&(n=0),a+n>o&&(a=o-n),a<0&&(a=0),this.width=i,this.scrollWidth=s,this.scrollLeft=r,this.height=n,this.scrollHeight=o,this.scrollTop=a}equals(t){return this.rawScrollLeft===t.rawScrollLeft&&this.rawScrollTop===t.rawScrollTop&&this.width===t.width&&this.scrollWidth===t.scrollWidth&&this.scrollLeft===t.scrollLeft&&this.height===t.height&&this.scrollHeight===t.scrollHeight&&this.scrollTop===t.scrollTop}withScrollDimensions(t,i){return new Rs(this._forceIntegerValues,typeof t.width<"u"?t.width:this.width,typeof t.scrollWidth<"u"?t.scrollWidth:this.scrollWidth,i?this.rawScrollLeft:this.scrollLeft,typeof t.height<"u"?t.height:this.height,typeof t.scrollHeight<"u"?t.scrollHeight:this.scrollHeight,i?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new Rs(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<"u"?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<"u"?t.scrollTop:this.rawScrollTop)}createScrollEvent(t,i){let s=this.width!==t.width,r=this.scrollWidth!==t.scrollWidth,n=this.scrollLeft!==t.scrollLeft,o=this.height!==t.height,a=this.scrollHeight!==t.scrollHeight,h=this.scrollTop!==t.scrollTop;return{inSmoothScrolling:i,oldWidth:t.width,oldScrollWidth:t.scrollWidth,oldScrollLeft:t.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:t.height,oldScrollHeight:t.scrollHeight,oldScrollTop:t.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:s,scrollWidthChanged:r,scrollLeftChanged:n,heightChanged:o,scrollHeightChanged:a,scrollTopChanged:h}}},Ad=class extends G{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new Td(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let i=this._state.withScrollDimensions(e,t);this._setState(i,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&(this._smoothScrolling.dispose(),this._smoothScrolling=null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>"u"?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>"u"?this._smoothScrolling.to.scrollTop:e.scrollTop};let i=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===i.scrollLeft&&this._smoothScrolling.to.scrollTop===i.scrollTop)return;let s;t?s=new jr(this._smoothScrolling.from,i,this._smoothScrolling.startTime,this._smoothScrolling.duration):s=this._smoothScrolling.combine(this._state,i,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=s}else{let i=this._state.withScrollPosition(e);this._smoothScrolling=jr.start(this._state,i,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),!!this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let i=this._state;i.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(i,t)))}},Yr=class{constructor(e,t,i){this.scrollLeft=e,this.scrollTop=t,this.isDone=i}};function es(e,t){let i=t-e;return function(s){return e+i*Od(s)}}function Id(e,t,i){return function(s){return s2.5*s){let r,n;return t{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?" fade":"")))}},Hd=140,ko=class extends mr{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new $d(e.visibility,"visible scrollbar "+e.extraScrollbarClassName,"invisible scrollbar "+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new Co),this._shouldRender=!0,this.domNode=ti(document.createElement("div")),this.domNode.setAttribute("role","presentation"),this.domNode.setAttribute("aria-hidden","true"),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition("absolute"),this._register(K(this.domNode.domNode,be.POINTER_DOWN,t=>this._domNodePointerDown(t)))}_createArrow(e){let t=this._register(new Pd(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,i,s){this.slider=ti(document.createElement("div")),this.slider.setClassName("slider"),this.slider.setPosition("absolute"),this.slider.setTop(e),this.slider.setLeft(t),typeof i=="number"&&this.slider.setWidth(i),typeof s=="number"&&this.slider.setHeight(s),this.slider.setLayerHinting(!0),this.slider.setContain("strict"),this.domNode.domNode.appendChild(this.slider.domNode),this._register(K(this.slider.domNode,be.POINTER_DOWN,r=>{r.button===0&&(r.preventDefault(),this._sliderPointerDown(r))})),this.onclick(this.slider.domNode,r=>{r.leftButton&&r.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,i=t+this._scrollbarState.getSliderPosition(),s=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),r=this._sliderPointerPosition(e);i<=r&&r<=s?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,i;if(e.target===this.domNode.domNode&&typeof e.offsetX=="number"&&typeof e.offsetY=="number")t=e.offsetX,i=e.offsetY;else{let r=Dd(this.domNode.domNode);t=e.pageX-r.left,i=e.pageY-r.top}let s=this._pointerDownRelativePosition(t,i);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(s):this._scrollbarState.getDesiredScrollPositionFromOffset(s)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),i=this._sliderOrthogonalPointerPosition(e),s=this._scrollbarState.clone();this.slider.toggleClassName("active",!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,r=>{let n=this._sliderOrthogonalPointerPosition(r),o=Math.abs(n-i);if(bo&&o>Hd){this._setDesiredScrollPositionNow(s.getScrollPosition());return}let a=this._sliderPointerPosition(r)-t;this._setDesiredScrollPositionNow(s.getDesiredScrollPositionFromDelta(a))},()=>{this.slider.toggleClassName("active",!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},xo=class Ps{constructor(t,i,s,r,n,o){this._scrollbarSize=Math.round(i),this._oppositeScrollbarSize=Math.round(s),this._arrowSize=Math.round(t),this._visibleSize=r,this._scrollSize=n,this._scrollPosition=o,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new Ps(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(t){let i=Math.round(t);return this._visibleSize!==i?(this._visibleSize=i,this._refreshComputedValues(),!0):!1}setScrollSize(t){let i=Math.round(t);return this._scrollSize!==i?(this._scrollSize=i,this._refreshComputedValues(),!0):!1}setScrollPosition(t){let i=Math.round(t);return this._scrollPosition!==i?(this._scrollPosition=i,this._refreshComputedValues(),!0):!1}setScrollbarSize(t){this._scrollbarSize=Math.round(t)}setOppositeScrollbarSize(t){this._oppositeScrollbarSize=Math.round(t)}static _computeValues(t,i,s,r,n){let o=Math.max(0,s-t),a=Math.max(0,o-2*i),h=r>0&&r>s;if(!h)return{computedAvailableSize:Math.round(o),computedIsNeeded:h,computedSliderSize:Math.round(a),computedSliderRatio:0,computedSliderPosition:0};let l=Math.round(Math.max(20,Math.floor(s*a/r))),d=(a-l)/(r-s),c=n*d;return{computedAvailableSize:Math.round(o),computedIsNeeded:h,computedSliderSize:Math.round(l),computedSliderRatio:d,computedSliderPosition:Math.round(c)}}_refreshComputedValues(){let t=Ps._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize-this._computedSliderSize/2;return Math.round(i/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(t){if(!this._computedIsNeeded)return 0;let i=t-this._arrowSize,s=this._scrollPosition;return i0&&Math.abs(t.deltaY)>0)return 1;let s=.5;if((!this._isAlmostInt(t.deltaX)||!this._isAlmostInt(t.deltaY))&&(s+=.25),i){let r=Math.abs(t.deltaX),n=Math.abs(t.deltaY),o=Math.abs(i.deltaX),a=Math.abs(i.deltaY),h=Math.max(Math.min(r,o),1),l=Math.max(Math.min(n,a),1),d=Math.max(r,o),c=Math.max(n,a);d%h===0&&c%l===0&&(s-=.5)}return Math.min(Math.max(s,0),1)}_isAlmostInt(t){return Math.abs(Math.round(t)-t)<.01}};Ts.INSTANCE=new Ts;var Vd=Ts,Kd=class extends mr{constructor(e,t,i){super(),this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new T),this.onWillScroll=this._onWillScroll.event,this._options=Yd(t),this._scrollable=i,this._register(this._scrollable.onScroll(r=>{this._onWillScroll.fire(r),this._onDidScroll(r),this._onScroll.fire(r)}));let s={onMouseWheel:r=>this._onMouseWheel(r),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new zd(this._scrollable,this._options,s)),this._horizontalScrollbar=this._register(new Fd(this._scrollable,this._options,s)),this._domNode=document.createElement("div"),this._domNode.className="xterm-scrollable-element "+this._options.className,this._domNode.setAttribute("role","presentation"),this._domNode.style.position="relative",this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=ti(document.createElement("div")),this._leftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=ti(document.createElement("div")),this._topShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=ti(document.createElement("div")),this._topLeftShadowDomNode.setClassName("shadow"),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,r=>this._onMouseOver(r)),this.onmouseleave(this._listenOnDomNode,r=>this._onMouseLeave(r)),this._hideTimeout=this._register(new gr),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=Mt(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,Je&&(this._options.className+=" mac"),this._domNode.className="xterm-scrollable-element "+this._options.className}updateOptions(e){typeof e.handleMouseWheel<"u"&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<"u"&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<"u"&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<"u"&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<"u"&&(this._options.horizontal=e.horizontal),typeof e.vertical<"u"&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<"u"&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<"u"&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<"u"&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new Wr(e))}_setListeningToMouseWheel(e){if(this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=Mt(this._mouseWheelToDispose),e)){let t=i=>{this._onMouseWheel(new Wr(i))};this._mouseWheelToDispose.push(K(this._listenOnDomNode,be.MOUSE_WHEEL,t,{passive:!1}))}}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=Vd.INSTANCE;t.acceptStandardWheelEvent(e);let i=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,n=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&n+r===0?n=r=0:Math.abs(r)>=Math.abs(n)?n=0:r=0),this._options.flipAxes&&([r,n]=[n,r]);let o=!Je&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||o)&&!n&&(n=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(n=n*this._options.fastScrollSensitivity,r=r*this._options.fastScrollSensitivity);let a=this._scrollable.getFutureScrollPosition(),h={};if(r){let l=Xr*r,d=a.scrollTop-(l<0?Math.floor(l):Math.ceil(l));this._verticalScrollbar.writeScrollPosition(h,d)}if(n){let l=Xr*n,d=a.scrollLeft-(l<0?Math.floor(l):Math.ceil(l));this._horizontalScrollbar.writeScrollPosition(h,d)}h=this._scrollable.validateScrollPosition(h),(a.scrollLeft!==h.scrollLeft||a.scrollTop!==h.scrollTop)&&(this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(h):this._scrollable.setScrollPositionNow(h),i=!0)}let s=i;!s&&this._options.alwaysConsumeMouseWheel&&(s=!0),!s&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(s=!0),s&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw new Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,i=e.scrollLeft>0,s=i?" left":"",r=t?" top":"",n=i||t?" top-left-corner":"";this._leftShadowDomNode.setClassName(`shadow${s}`),this._topShadowDomNode.setClassName(`shadow${r}`),this._topLeftShadowDomNode.setClassName(`shadow${n}${r}${s}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),Wd)}},qd=class extends Kd{constructor(e,t,i){super(e,t,i)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function Yd(e){let t={lazyRender:typeof e.lazyRender<"u"?e.lazyRender:!1,className:typeof e.className<"u"?e.className:"",useShadows:typeof e.useShadows<"u"?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<"u"?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<"u"?e.flipAxes:!1,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<"u"?e.consumeMouseWheelIfScrollbarIsNeeded:!1,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<"u"?e.alwaysConsumeMouseWheel:!1,scrollYToX:typeof e.scrollYToX<"u"?e.scrollYToX:!1,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<"u"?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<"u"?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<"u"?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<"u"?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<"u"?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<"u"?e.listenOnDomNode:null,horizontal:typeof e.horizontal<"u"?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<"u"?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<"u"?e.horizontalHasArrows:!1,vertical:typeof e.vertical<"u"?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<"u"?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<"u"?e.verticalHasArrows:!1,verticalSliderSize:typeof e.verticalSliderSize<"u"?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<"u"?e.scrollByPage:!1};return t.horizontalSliderSize=typeof e.horizontalSliderSize<"u"?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<"u"?e.verticalSliderSize:t.verticalScrollbarSize,Je&&(t.className+=" mac"),t}var As=class extends G{constructor(e,t,i,s,r,n,o,a){super(),this._bufferService=i,this._optionsService=o,this._renderService=a,this._onRequestScrollLines=this._register(new T),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let h=this._register(new Ad({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:l=>vr(s.window,l)}));this._register(this._optionsService.onSpecificOptionChange("smoothScrollDuration",()=>{h.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new qd(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},h)),this._register(this._optionsService.onMultipleOptionChange(["scrollSensitivity","fastScrollSensitivity","overviewRuler"],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(r.onProtocolChange(l=>{this._scrollableElement.updateOptions({handleMouseWheel:!(l&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(ke.runAndSubscribe(n.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=n.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(ne(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=s.mainDocument.createElement("style"),t.appendChild(this._styleElement),this._register(ne(()=>this._styleElement.remove())),this._register(ke.runAndSubscribe(n.onChangeColors,()=>{this._styleElement.textContent=[".xterm .xterm-scrollable-element > .scrollbar > .slider {",` background: ${n.colors.scrollbarSliderBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider:hover {",` background: ${n.colors.scrollbarSliderHoverBackground.css};`,"}",".xterm .xterm-scrollable-element > .scrollbar > .slider.active {",` background: ${n.colors.scrollbarSliderActiveBackground.css};`,"}"].join(` +`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(l=>this._handleScroll(l)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),i=t-this._bufferService.buffer.ydisp;i!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(i)),this._isHandlingScroll=!1}};As=he([$(2,Le),$(3,at),$(4,ro),$(5,Ft),$(6,Pe),$(7,lt)],As);var Is=class extends G{constructor(e,t,i,s,r){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=i,this._decorationService=s,this._renderService=r,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(n=>this._removeDecoration(n))),this._register(ne(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement("div");t.classList.add("xterm-decoration"),t.classList.toggle("xterm-decoration-top-layer",e?.options?.layer==="top"),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let i=e.options.x??0;return i&&i>this._bufferService.cols&&(t.style.display="none"),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display="none",e.onRenderEmitter.fire(e.element));else{let i=this._decorationElements.get(e);i||(i=this._createElement(e),e.element=i,this._decorationElements.set(e,i),this._container.appendChild(i),e.onDispose(()=>{this._decorationElements.delete(e),i.remove()})),i.style.display=this._altBufferIsActive?"none":"block",this._altBufferIsActive||(i.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,i.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,i.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,i.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(i)}}_refreshXPosition(e,t=e.element){if(!t)return;let i=e.options.x??0;(e.options.anchor||"left")==="right"?t.style.right=i?`${i*this._renderService.dimensions.css.cell.width}px`:"":t.style.left=i?`${i*this._renderService.dimensions.css.cell.width}px`:""}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};Is=he([$(1,Le),$(2,at),$(3,li),$(4,lt)],Is);var jd=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,i){return t>=e.startBufferLine-this._linePadding[i||"full"]&&t<=e.endBufferLine+this._linePadding[i||"full"]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},Ye={full:0,left:0,center:0,right:0},ut={full:0,left:0,center:0,right:0},Ut={full:0,left:0,center:0,right:0},Ii=class extends G{constructor(e,t,i,s,r,n,o,a){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=i,this._decorationService=s,this._renderService=r,this._optionsService=n,this._themeService=o,this._coreBrowserService=a,this._colorZoneStore=new jd,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(ne(()=>this._canvas?.remove()));let h=this._canvas.getContext("2d");if(h)this._ctx=h;else throw new Error("Ctx cannot be null");this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange("overviewRuler",()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);ut.full=this._canvas.width,ut.left=e,ut.center=t,ut.right=e,this._refreshDrawHeightConstants(),Ut.full=1,Ut.left=1,Ut.center=1+ut.left,Ut.right=1+ut.left+ut.center}_refreshDrawHeightConstants(){Ye.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);Ye.left=t,Ye.center=t,Ye.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*Ye.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let t of this._decorationService.decorations)this._colorZoneStore.addDecoration(t);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!=="full"&&this._renderColorZone(t);for(let t of e)t.position==="full"&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(Ut[e.position||"full"],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-Ye[e.position||"full"]/2),ut[e.position||"full"],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+Ye[e.position||"full"]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};Ii=he([$(2,Le),$(3,li),$(4,lt),$(5,Pe),$(6,Ft),$(7,at)],Ii);var y;(e=>(e.NUL="\0",e.SOH="",e.STX="",e.ETX="",e.EOT="",e.ENQ="",e.ACK="",e.BEL="\x07",e.BS="\b",e.HT=" ",e.LF=` +`,e.VT="\v",e.FF="\f",e.CR="\r",e.SO="",e.SI="",e.DLE="",e.DC1="",e.DC2="",e.DC3="",e.DC4="",e.NAK="",e.SYN="",e.ETB="",e.CAN="",e.EM="",e.SUB="",e.ESC="\x1B",e.FS="",e.GS="",e.RS="",e.US="",e.SP=" ",e.DEL=""))(y||={});var Mi;(e=>(e.PAD="€",e.HOP="",e.BPH="‚",e.NBH="ƒ",e.IND="„",e.NEL="…",e.SSA="†",e.ESA="‡",e.HTS="ˆ",e.HTJ="‰",e.VTS="Š",e.PLD="‹",e.PLU="Œ",e.RI="",e.SS2="Ž",e.SS3="",e.DCS="",e.PU1="‘",e.PU2="’",e.STS="“",e.CCH="”",e.MW="•",e.SPA="–",e.EPA="—",e.SOS="˜",e.SGCI="™",e.SCI="š",e.CSI="›",e.ST="œ",e.OSC="",e.PM="ž",e.APC="Ÿ"))(Mi||={});var Eo;(e=>e.ST=`${y.ESC}\\`)(Eo||={});var Ns=class{constructor(e,t,i,s,r,n){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=s,this._coreService=r,this._renderService=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode===229?(this._handleAnyTextareaChanges(),!1):!0}_finalizeComposition(e){if(this._compositionView.classList.remove("active"),this._isComposing=!1,e){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let i;t.start+=this._dataAlreadySent.length,this._isComposing?i=this._textarea.value.substring(t.start,this._compositionPosition.start):i=this._textarea.value.substring(t.start),i.length>0&&this._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,i=t.replace(e,"");this._dataAlreadySent=i,t.length>e.length?this._coreService.triggerDataEvent(i,!0):t.lengththis.updateCompositionElements(!0),0)}}};Ns=he([$(2,Le),$(3,Pe),$(4,Lt),$(5,lt)],Ns);var Se=0,we=0,ye=0,le=0,Gr={css:"#00000000",rgba:0},_e;(e=>{function t(r,n,o,a){return a!==void 0?`#${bt(r)}${bt(n)}${bt(o)}${bt(a)}`:`#${bt(r)}${bt(n)}${bt(o)}`}e.toCss=t;function i(r,n,o,a=255){return(r<<24|n<<16|o<<8|a)>>>0}e.toRgba=i;function s(r,n,o,a){return{css:e.toCss(r,n,o,a),rgba:e.toRgba(r,n,o,a)}}e.toColor=s})(_e||={});var re;(e=>{function t(h,l){if(le=(l.rgba&255)/255,le===1)return{css:l.css,rgba:l.rgba};let d=l.rgba>>24&255,c=l.rgba>>16&255,u=l.rgba>>8&255,v=h.rgba>>24&255,_=h.rgba>>16&255,m=h.rgba>>8&255;Se=v+Math.round((d-v)*le),we=_+Math.round((c-_)*le),ye=m+Math.round((u-m)*le);let C=_e.toCss(Se,we,ye),M=_e.toRgba(Se,we,ye);return{css:C,rgba:M}}e.blend=t;function i(h){return(h.rgba&255)===255}e.isOpaque=i;function s(h,l,d){let c=Ri.ensureContrastRatio(h.rgba,l.rgba,d);if(c)return _e.toColor(c>>24&255,c>>16&255,c>>8&255)}e.ensureContrastRatio=s;function r(h){let l=(h.rgba|255)>>>0;return[Se,we,ye]=Ri.toChannels(l),{css:_e.toCss(Se,we,ye),rgba:l}}e.opaque=r;function n(h,l){return le=Math.round(l*255),[Se,we,ye]=Ri.toChannels(h.rgba),{css:_e.toCss(Se,we,ye,le),rgba:_e.toRgba(Se,we,ye,le)}}e.opacity=n;function o(h,l){return le=h.rgba&255,n(h,le*l/255)}e.multiplyOpacity=o;function a(h){return[h.rgba>>24&255,h.rgba>>16&255,h.rgba>>8&255]}e.toColorRGB=a})(re||={});var ae;(e=>{let t,i;try{let r=document.createElement("canvas");r.width=1,r.height=1;let n=r.getContext("2d",{willReadFrequently:!0});n&&(t=n,t.globalCompositeOperation="copy",i=t.createLinearGradient(0,0,1,1))}catch{}function s(r){if(r.match(/#[\da-f]{3,8}/i))switch(r.length){case 4:return Se=parseInt(r.slice(1,2).repeat(2),16),we=parseInt(r.slice(2,3).repeat(2),16),ye=parseInt(r.slice(3,4).repeat(2),16),_e.toColor(Se,we,ye);case 5:return Se=parseInt(r.slice(1,2).repeat(2),16),we=parseInt(r.slice(2,3).repeat(2),16),ye=parseInt(r.slice(3,4).repeat(2),16),le=parseInt(r.slice(4,5).repeat(2),16),_e.toColor(Se,we,ye,le);case 7:return{css:r,rgba:(parseInt(r.slice(1),16)<<8|255)>>>0};case 9:return{css:r,rgba:parseInt(r.slice(1),16)>>>0}}let n=r.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(n)return Se=parseInt(n[1]),we=parseInt(n[2]),ye=parseInt(n[3]),le=Math.round((n[5]===void 0?1:parseFloat(n[5]))*255),_e.toColor(Se,we,ye,le);if(!t||!i)throw new Error("css.toColor: Unsupported css format");if(t.fillStyle=i,t.fillStyle=r,typeof t.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(t.fillRect(0,0,1,1),[Se,we,ye,le]=t.getImageData(0,0,1,1).data,le!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:_e.toRgba(Se,we,ye,le),css:r}}e.toColor=s})(ae||={});var Me;(e=>{function t(s){return i(s>>16&255,s>>8&255,s&255)}e.relativeLuminance=t;function i(s,r,n){let o=s/255,a=r/255,h=n/255,l=o<=.03928?o/12.92:Math.pow((o+.055)/1.055,2.4),d=a<=.03928?a/12.92:Math.pow((a+.055)/1.055,2.4),c=h<=.03928?h/12.92:Math.pow((h+.055)/1.055,2.4);return l*.2126+d*.7152+c*.0722}e.relativeLuminance2=i})(Me||={});var Ri;(e=>{function t(o,a){if(le=(a&255)/255,le===1)return a;let h=a>>24&255,l=a>>16&255,d=a>>8&255,c=o>>24&255,u=o>>16&255,v=o>>8&255;return Se=c+Math.round((h-c)*le),we=u+Math.round((l-u)*le),ye=v+Math.round((d-v)*le),_e.toRgba(Se,we,ye)}e.blend=t;function i(o,a,h){let l=Me.relativeLuminance(o>>8),d=Me.relativeLuminance(a>>8);if(tt(l,d)>8));if(_>8));return _>C?v:m}return v}let c=r(o,a,h),u=tt(l,Me.relativeLuminance(c>>8));if(u>8));return u>_?c:v}return c}}e.ensureContrastRatio=i;function s(o,a,h){let l=o>>24&255,d=o>>16&255,c=o>>8&255,u=a>>24&255,v=a>>16&255,_=a>>8&255,m=tt(Me.relativeLuminance2(u,v,_),Me.relativeLuminance2(l,d,c));for(;m0||v>0||_>0);)u-=Math.max(0,Math.ceil(u*.1)),v-=Math.max(0,Math.ceil(v*.1)),_-=Math.max(0,Math.ceil(_*.1)),m=tt(Me.relativeLuminance2(u,v,_),Me.relativeLuminance2(l,d,c));return(u<<24|v<<16|_<<8|255)>>>0}e.reduceLuminance=s;function r(o,a,h){let l=o>>24&255,d=o>>16&255,c=o>>8&255,u=a>>24&255,v=a>>16&255,_=a>>8&255,m=tt(Me.relativeLuminance2(u,v,_),Me.relativeLuminance2(l,d,c));for(;m>>0}e.increaseLuminance=r;function n(o){return[o>>24&255,o>>16&255,o>>8&255,o&255]}e.toChannels=n})(Ri||={});function bt(e){let t=e.toString(16);return t.length<2?"0"+t:t}function tt(e,t){return e1){let d=this._getJoinedRanges(s,o,n,t,r);for(let c=0;c1){let l=this._getJoinedRanges(s,o,n,t,r);for(let d=0;d=R,w=b,S=this._workCell;if(u.length>0&&b===u[0][0]&&D){let ee=u.shift(),qi=this._isCellInSelection(ee[0],t);for(H=ee[0]+1;H=ee[1],D?(O=!0,S=new Xd(this._workCell,e.translateToString(!0,ee[0],ee[1]),ee[1]-ee[0]),w=ee[1]-1,P=S.getWidth()):R=ee[1]}let z=this._isCellInSelection(b,t),Z=i&&b===n,se=k&&b>=l&&b<=d,xe=!1;this._decorationService.forEachDecorationAtCell(b,t,void 0,ee=>{xe=!0});let De=S.getChars()||pt;if(De===" "&&(S.isUnderline()||S.isOverline())&&(De=" "),F=P*a-h.get(De,S.isBold(),S.isItalic()),!m)m=this._document.createElement("span");else if(C&&(z&&V||!z&&!V&&S.bg===I)&&(z&&V&&v.selectionForeground||S.fg===f)&&S.extended.ext===L&&se===B&&F===U&&!Z&&!O&&!xe&&D){S.isInvisible()?M+=pt:M+=De,C++;continue}else C&&(m.textContent=M),m=this._document.createElement("span"),C=0,M="";if(I=S.bg,f=S.fg,L=S.extended.ext,B=se,U=F,V=z,O&&n>=b&&n<=w&&(n=b),!this._coreService.isCursorHidden&&Z&&this._coreService.isCursorInitialized){if(N.push("xterm-cursor"),this._coreBrowserService.isFocused)o&&N.push("xterm-cursor-blink"),N.push(s==="bar"?"xterm-cursor-bar":s==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(r)switch(r){case"outline":N.push("xterm-cursor-outline");break;case"block":N.push("xterm-cursor-block");break;case"bar":N.push("xterm-cursor-bar");break;case"underline":N.push("xterm-cursor-underline");break}}if(S.isBold()&&N.push("xterm-bold"),S.isItalic()&&N.push("xterm-italic"),S.isDim()&&N.push("xterm-dim"),S.isInvisible()?M=pt:M=S.getChars()||pt,S.isUnderline()&&(N.push(`xterm-underline-${S.extended.underlineStyle}`),M===" "&&(M=" "),!S.isUnderlineColorDefault()))if(S.isUnderlineColorRGB())m.style.textDecorationColor=`rgb(${ai.toColorRGB(S.getUnderlineColor()).join(",")})`;else{let ee=S.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&S.isBold()&&ee<8&&(ee+=8),m.style.textDecorationColor=v.ansi[ee].css}S.isOverline()&&(N.push("xterm-overline"),M===" "&&(M=" ")),S.isStrikethrough()&&N.push("xterm-strikethrough"),se&&(m.style.textDecoration="underline");let Te=S.getFgColor(),qe=S.getFgColorMode(),Fe=S.getBgColor(),mt=S.getBgColorMode(),Ki=!!S.isInverse();if(Ki){let ee=Te;Te=Fe,Fe=ee;let qi=qe;qe=mt,mt=qi}let ht,di,Wt=!1;this._decorationService.forEachDecorationAtCell(b,t,void 0,ee=>{ee.options.layer!=="top"&&Wt||(ee.backgroundColorRGB&&(mt=50331648,Fe=ee.backgroundColorRGB.rgba>>8&16777215,ht=ee.backgroundColorRGB),ee.foregroundColorRGB&&(qe=50331648,Te=ee.foregroundColorRGB.rgba>>8&16777215,di=ee.foregroundColorRGB),Wt=ee.options.layer==="top")}),!Wt&&z&&(ht=this._coreBrowserService.isFocused?v.selectionBackgroundOpaque:v.selectionInactiveBackgroundOpaque,Fe=ht.rgba>>8&16777215,mt=50331648,Wt=!0,v.selectionForeground&&(qe=50331648,Te=v.selectionForeground.rgba>>8&16777215,di=v.selectionForeground)),Wt&&N.push("xterm-decoration-top");let ct;switch(mt){case 16777216:case 33554432:ct=v.ansi[Fe],N.push(`xterm-bg-${Fe}`);break;case 50331648:ct=_e.toColor(Fe>>16,Fe>>8&255,Fe&255),this._addStyle(m,`background-color:#${Zr((Fe>>>0).toString(16),"0",6)}`);break;default:Ki?(ct=v.foreground,N.push("xterm-bg-257")):ct=v.background}switch(ht||S.isDim()&&(ht=re.multiplyOpacity(ct,.5)),qe){case 16777216:case 33554432:S.isBold()&&Te<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(Te+=8),this._applyMinimumContrast(m,ct,v.ansi[Te],S,ht,void 0)||N.push(`xterm-fg-${Te}`);break;case 50331648:let ee=_e.toColor(Te>>16&255,Te>>8&255,Te&255);this._applyMinimumContrast(m,ct,ee,S,ht,di)||this._addStyle(m,`color:#${Zr(Te.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(m,ct,v.foreground,S,ht,di)||Ki&&N.push("xterm-fg-257")}N.length&&(m.className=N.join(" "),N.length=0),!Z&&!O&&!xe&&D?C++:m.textContent=M,F!==this.defaultSpacing&&(m.style.letterSpacing=`${F}px`),c.push(m),b=w}return m&&C&&(m.textContent=M),c}_applyMinimumContrast(e,t,i,s,r,n){if(this._optionsService.rawOptions.minimumContrastRatio===1||Jd(s.getCode()))return!1;let o=this._getContrastCache(s),a;if(!r&&!n&&(a=o.getColor(t.rgba,i.rgba)),a===void 0){let h=this._optionsService.rawOptions.minimumContrastRatio/(s.isDim()?2:1);a=re.ensureContrastRatio(r||t,n||i,h),o.setColor((r||t).rgba,(n||i).rgba,a??null)}return a?(this._addStyle(e,`color:${a.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute("style",`${e.getAttribute("style")||""}${t};`)}_isCellInSelection(e,t){let i=this._selectionStart,s=this._selectionEnd;return!i||!s?!1:this._columnSelectMode?i[0]<=s[0]?e>=i[0]&&t>=i[1]&&e=i[1]&&e>=s[0]&&t<=s[1]:t>i[1]&&t=i[0]&&e=i[0]}};Os=he([$(1,ao),$(2,Pe),$(3,at),$(4,Lt),$(5,li),$(6,Ft)],Os);function Zr(e,t,i){for(;e.length0&&(this._flat[s]=o),o}let r=e;t&&(r+="B"),i&&(r+="I");let n=this._holey.get(r);if(n===void 0){let o=0;t&&(o|=1),i&&(o|=2),n=this._measure(e,o),n>0&&this._holey.set(r,n)}return n}_measure(e,t){let i=this._measureElements[t];return i.textContent=e.repeat(32),i.offsetWidth/32}},tu=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,i,s=!1){if(this.selectionStart=t,this.selectionEnd=i,!t||!i||t[0]===i[0]&&t[1]===i[1]){this.clear();return}let r=e.buffers.active.ydisp,n=t[1]-r,o=i[1]-r,a=Math.max(n,0),h=Math.min(o,e.rows-1);if(a>=e.rows||h<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=s,this.viewportStartRow=n,this.viewportEndRow=o,this.viewportCappedStartRow=a,this.viewportCappedEndRow=h,this.startCol=t[0],this.endCol=i[0]}isCellSelected(e,t,i){return this.hasSelection?(i-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&i>=this.viewportCappedStartRow&&t=this.viewportCappedStartRow&&t>=this.endCol&&i<=this.viewportCappedEndRow:i>this.viewportStartRow&&i=this.startCol&&t=this.startCol):!1}};function iu(){return new tu}var ts="xterm-dom-renderer-owner-",ze="xterm-rows",mi="xterm-fg-",Jr="xterm-bg-",Vt="xterm-focus",bi="xterm-selection",su=1,$s=class extends G{constructor(e,t,i,s,r,n,o,a,h,l,d,c,u,v){super(),this._terminal=e,this._document=t,this._element=i,this._screenElement=s,this._viewportElement=r,this._helperContainer=n,this._linkifier2=o,this._charSizeService=h,this._optionsService=l,this._bufferService=d,this._coreService=c,this._coreBrowserService=u,this._themeService=v,this._terminalClass=su++,this._rowElements=[],this._selectionRenderModel=iu(),this.onRequestRedraw=this._register(new T).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(ze),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement("div"),this._selectionContainer.classList.add(bi),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=Qd(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(_=>this._injectCss(_))),this._injectCss(this._themeService.colors),this._rowFactory=a.createInstance(Os,document),this._element.classList.add(ts+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(_=>this._handleLinkHover(_))),this._register(this._linkifier2.onHideLinkUnderline(_=>this._handleLinkLeave(_))),this._register(ne(()=>{this._element.classList.remove(ts+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new eu(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let i of this._rowElements)i.style.width=`${this.dimensions.css.canvas.width}px`,i.style.height=`${this.dimensions.css.cell.height}px`,i.style.lineHeight=`${this.dimensions.css.cell.height}px`,i.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${ze} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${ze} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${ze} .xterm-dim { color: ${re.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let i=`blink_underline_${this._terminalClass}`,s=`blink_bar_${this._terminalClass}`,r=`blink_block_${this._terminalClass}`;t+=`@keyframes ${i} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${s} { 50% { box-shadow: none; }}`,t+=`@keyframes ${r} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${ze}.${Vt} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${ze}.${Vt} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${s} 1s step-end infinite;}${this._terminalSelector} .${ze}.${Vt} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${ze} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${bi} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${bi} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${bi} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,o]of e.ansi.entries())t+=`${this._terminalSelector} .${mi}${n} { color: ${o.css}; }${this._terminalSelector} .${mi}${n}.xterm-dim { color: ${re.multiplyOpacity(o,.5).css}; }${this._terminalSelector} .${Jr}${n} { background-color: ${o.css}; }`;t+=`${this._terminalSelector} .${mi}257 { color: ${re.opaque(e.background).css}; }${this._terminalSelector} .${mi}257.xterm-dim { color: ${re.multiplyOpacity(re.opaque(e.background),.5).css}; }${this._terminalSelector} .${Jr}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let i=this._rowElements.length;i<=t;i++){let s=this._document.createElement("div");this._rowContainer.appendChild(s),this._rowElements.push(s)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(Vt),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(Vt),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,i){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,i),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,i),!this._selectionRenderModel.hasSelection))return;let s=this._selectionRenderModel.viewportStartRow,r=this._selectionRenderModel.viewportEndRow,n=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,a=this._document.createDocumentFragment();if(i){let h=e[0]>t[0];a.appendChild(this._createSelectionElement(n,h?t[0]:e[0],h?e[0]:t[0],o-n+1))}else{let h=s===n?e[0]:0,l=n===r?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(n,h,l));let d=o-n-1;if(a.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,d)),n!==o){let c=r===o?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,0,c))}}this._selectionContainer.appendChild(a)}_createSelectionElement(e,t,i,s=1){let r=this._document.createElement("div"),n=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(i-t);return n+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-n),r.style.height=`${s*this.dimensions.css.cell.height}px`,r.style.top=`${e*this.dimensions.css.cell.height}px`,r.style.left=`${n}px`,r.style.width=`${o}px`,r}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let i=this._bufferService.buffer,s=i.ybase+i.y,r=Math.min(i.x,this._bufferService.cols-1),n=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,a=this._optionsService.rawOptions.cursorInactiveStyle;for(let h=e;h<=t;h++){let l=h+i.ydisp,d=this._rowElements[h],c=i.lines.get(l);if(!d||!c)break;d.replaceChildren(...this._rowFactory.createRow(c,l,l===s,o,a,r,n,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${ts}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,i,s,r,n){i<0&&(e=0),s<0&&(t=0);let o=this._bufferService.rows-1;i=Math.max(Math.min(i,o),0),s=Math.max(Math.min(s,o),0),r=Math.min(r,this._bufferService.cols);let a=this._bufferService.buffer,h=a.ybase+a.y,l=Math.min(a.x,r-1),d=this._optionsService.rawOptions.cursorBlink,c=this._optionsService.rawOptions.cursorStyle,u=this._optionsService.rawOptions.cursorInactiveStyle;for(let v=i;v<=s;++v){let _=v+a.ydisp,m=this._rowElements[v],C=a.lines.get(_);if(!m||!C)break;m.replaceChildren(...this._rowFactory.createRow(C,_,_===h,c,u,l,d,this.dimensions.css.cell.width,this._widthCache,n?v===i?e:0:-1,n?(v===s?t:r)-1:-1))}}};$s=he([$(7,dr),$(8,Wi),$(9,Pe),$(10,Le),$(11,Lt),$(12,at),$(13,Ft)],$s);var Hs=class extends G{constructor(e,t,i){super(),this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=this._register(new T),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new nu(this._optionsService))}catch{this._measureStrategy=this._register(new ru(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};Hs=he([$(2,Pe)],Hs);var Bo=class extends G{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},ru=class extends Bo{constructor(e,t,i){super(),this._document=e,this._parentElement=t,this._optionsService=i,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},nu=class extends Bo{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");let t=this._ctx.measureText("W");if(!("width"in t&&"fontBoundingBoxAscent"in t&&"fontBoundingBoxDescent"in t))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText("W");return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},ou=class extends G{constructor(e,t,i){super(),this._textarea=e,this._window=t,this.mainDocument=i,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new au(this._window)),this._onDprChange=this._register(new T),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new T),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(s=>this._screenDprMonitor.setWindow(s))),this._register(ke.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(K(this._textarea,"focus",()=>this._isFocused=!0)),this._register(K(this._textarea,"blur",()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},au=class extends G{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new Nt),this._onDprChange=this._register(new T),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(ne(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=K(this._parentWindow,"resize",()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},lu=class extends G{constructor(){super(),this.linkProviders=[],this._register(ne(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function br(e,t,i){let s=i.getBoundingClientRect(),r=e.getComputedStyle(i),n=parseInt(r.getPropertyValue("padding-left")),o=parseInt(r.getPropertyValue("padding-top"));return[t.clientX-s.left-n,t.clientY-s.top-o]}function hu(e,t,i,s,r,n,o,a,h){if(!n)return;let l=br(e,t,i);if(l)return l[0]=Math.ceil((l[0]+(h?o/2:0))/o),l[1]=Math.ceil(l[1]/a),l[0]=Math.min(Math.max(l[0],1),s+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),r),l}var Fs=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,i,s,r){return hu(window,e,t,i,s,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,r)}getMouseReportCoords(e,t){let i=br(window,e,t);if(this._charSizeService.hasValidSize)return i[0]=Math.min(Math.max(i[0],0),this._renderService.dimensions.css.canvas.width-1),i[1]=Math.min(Math.max(i[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(i[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(i[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(i[0]),y:Math.floor(i[1])}}};Fs=he([$(0,lt),$(1,Wi)],Fs);var cu=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(e,t,i){this._rowCount=i,e=e!==void 0?e:0,t=t!==void 0?t:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,e):e,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,t):t,!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},Do={};Sc(Do,{getSafariVersion:()=>uu,isChromeOS:()=>Po,isFirefox:()=>Mo,isIpad:()=>_u,isIphone:()=>fu,isLegacyEdge:()=>du,isLinux:()=>Sr,isMac:()=>Oi,isNode:()=>Ui,isSafari:()=>Ro,isWindows:()=>Lo});var Ui=typeof process<"u"&&"title"in process,hi=Ui?"node":navigator.userAgent,ci=Ui?"node":navigator.platform,Mo=hi.includes("Firefox"),du=hi.includes("Edge"),Ro=/^((?!chrome|android).)*safari/i.test(hi);function uu(){if(!Ro)return 0;let e=hi.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var Oi=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(ci),_u=ci==="iPad",fu=ci==="iPhone",Lo=["Windows","Win16","Win32","WinCE"].includes(ci),Sr=ci.indexOf("Linux")>=0,Po=/\bCrOS\b/.test(hi),To=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._ir){s-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(s-t))}ms`),this._start();return}s=r}this.clear()}},pu=class extends To{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},gu=class extends To{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},$i=!Ui&&"requestIdleCallback"in window?gu:pu,vu=class{constructor(){this._queue=new $i}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},zs=class extends G{constructor(e,t,i,s,r,n,o,a,h){super(),this._rowCount=e,this._optionsService=i,this._charSizeService=s,this._coreService=r,this._coreBrowserService=a,this._renderer=this._register(new Nt),this._pausedResizeTask=new vu,this._observerDisposable=this._register(new Nt),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new T),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new T),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new T),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new T),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new cu((l,d)=>this._renderRows(l,d),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new mu(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(ne(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(n.onDecorationRegistered(()=>this._fullRefresh())),this._register(n.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(h.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(l=>this._registerIntersectionObserver(l,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if("IntersectionObserver"in e){let i=new e.IntersectionObserver(s=>this._handleIntersectionChange(s[s.length-1]),{threshold:0});i.observe(t),this._observerDisposable.value=ne(()=>i.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,i=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let s=this._syncOutputHandler.flush();s&&(e=Math.min(e,s.start),t=Math.max(t,s.end)),i||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(t=>this.refreshRows(t.start,t.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,i){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=i,this._renderer.value?.handleSelectionChanged(e,t,i)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};zs=he([$(2,Pe),$(3,Wi),$(4,Lt),$(5,li),$(6,Le),$(7,at),$(8,Ft)],zs);var mu=class{constructor(e,t,i){this._coreBrowserService=e,this._coreService=t,this._onTimeout=i,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function bu(e,t,i,s){let r=i.buffer.x,n=i.buffer.y;if(!i.buffer.hasScrollback)return yu(r,n,e,t,i,s)+Vi(n,t,i,s)+Cu(r,n,e,t,i,s);let o;if(n===t)return o=r>e?"D":"C",ni(Math.abs(r-e),ri(o,s));o=n>t?"D":"C";let a=Math.abs(n-t),h=wu(n>t?e:r,i)+(a-1)*i.cols+1+Su(n>t?r:e);return ni(h,ri(o,s))}function Su(e,t){return e-1}function wu(e,t){return t.cols-e}function yu(e,t,i,s,r,n){return Vi(t,s,r,n).length===0?"":ni(Io(e,t,e,t-Rt(t,r),!1,r).length,ri("D",n))}function Vi(e,t,i,s){let r=e-Rt(e,i),n=t-Rt(t,i),o=Math.abs(r-n)-ku(e,t,i);return ni(o,ri(Ao(e,t),s))}function Cu(e,t,i,s,r,n){let o;Vi(t,s,r,n).length>0?o=s-Rt(s,r):o=t;let a=s,h=xu(e,t,i,s,r,n);return ni(Io(e,o,i,a,h==="C",r).length,ri(h,n))}function ku(e,t,i){let s=0,r=e-Rt(e,i),n=t-Rt(t,i);for(let o=0;o=0&&e0?o=s-Rt(s,r):o=t,e=i&&ot?"A":"B"}function Io(e,t,i,s,r,n){let o=e,a=t,h="";for(;(o!==i||a!==s)&&a>=0&&an.cols-1?(h+=n.buffer.translateBufferLineToString(a,!1,e,o),o=0,e=0,a++):!r&&o<0&&(h+=n.buffer.translateBufferLineToString(a,!1,0,e+1),o=n.cols-1,e=o,a--);return h+n.buffer.translateBufferLineToString(a,!1,e,o)}function ri(e,t){let i=t?"O":"[";return y.ESC+i+e}function ni(e,t){e=Math.floor(e);let i="";for(let s=0;sthis._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function Qr(e,t){if(e.start.y>e.end.y)throw new Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var is=50,Bu=15,Du=50,Mu=500,Ru=" ",Lu=new RegExp(Ru,"g"),Ws=class extends G{constructor(e,t,i,s,r,n,o,a,h){super(),this._element=e,this._screenElement=t,this._linkifier=i,this._bufferService=s,this._coreService=r,this._mouseService=n,this._optionsService=o,this._renderService=a,this._coreBrowserService=h,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new Ve,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new T),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new T),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new T),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new T),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=l=>this._handleMouseMove(l),this._mouseUpListener=l=>this._handleMouseUp(l),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(l=>this._handleTrim(l)),this._register(this._bufferService.buffers.onBufferActivate(l=>this._handleBufferActivate(l))),this.enable(),this._model=new Eu(this._bufferService),this._activeSelectionMode=0,this._register(ne(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(l=>{l.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";let i=this._bufferService.buffer,s=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return"";let r=e[0]r.replace(Lu," ")).join(Lo?`\r `:` -`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),mr&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=Zr(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=vr(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-is),is),t/=is,t/Math.abs(t)+Math.round(t*(Mu-1)))}shouldForceSelection(e){return Oi?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),Ru)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Oi&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&tthis._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let o=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),h=a,l=e[0]-a,d=0,c=0,u=0,v=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;h1&&(v+=F-1,h+=F-1);C>0&&a>0&&!this._isCharWordSeparator(n.loadCell(C-1,this._workCell));){n.loadCell(C-1,this._workCell);let N=this._workCell.getChars().length;this._workCell.getWidth()===0?(d++,C--):N>1&&(u+=N-1,a-=N-1),a--,C--}for(;M1&&(v+=N-1,h+=N-1),h++,M++}}h++;let _=a+l-d+u,m=Math.min(this._bufferService.cols,h-a+d+c-u-v);if(!(!t&&o.slice(a,h).trim()==="")){if(i&&_===0&&n.getCodePoint(0)!==32){let C=r.lines.get(e[1]-1);if(C&&n.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let M=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(M){let F=this._bufferService.cols-M.start;_-=F,m+=F}}}if(s&&_+m===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let C=r.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let M=this._getWordAt([0,e[1]+1],!1,!1,!0);M&&(m+=M.length)}}return{start:_,length:m}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Zr(i,this._bufferService.cols)}};Ws=he([$(3,Le),$(4,Lt),$(5,cr),$(6,Pe),$(7,lt),$(8,at)],Ws);var Jr=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},Qr=class{constructor(){this._color=new Jr,this._css=new Jr}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},pe=Object.freeze((()=>{let e=[ae.toColor("#2e3436"),ae.toColor("#cc0000"),ae.toColor("#4e9a06"),ae.toColor("#c4a000"),ae.toColor("#3465a4"),ae.toColor("#75507b"),ae.toColor("#06989a"),ae.toColor("#d3d7cf"),ae.toColor("#555753"),ae.toColor("#ef2929"),ae.toColor("#8ae234"),ae.toColor("#fce94f"),ae.toColor("#729fcf"),ae.toColor("#ad7fa8"),ae.toColor("#34e2e2"),ae.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:_e.toCss(s,r,n),rgba:_e.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:_e.toCss(s,s,s),rgba:_e.toRgba(s,s,s)})}return e})()),wt=ae.toColor("#ffffff"),Zt=ae.toColor("#000000"),en=ae.toColor("#ffffff"),tn=Zt,Kt={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Au=wt,Us=class extends G{constructor(e){super(),this._optionsService=e,this._contrastCache=new Qr,this._halfContrastCache=new Qr,this._onChangeColors=this._register(new T),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:wt,background:Zt,cursor:en,cursorAccent:tn,selectionForeground:void 0,selectionBackgroundTransparent:Kt,selectionBackgroundOpaque:re.blend(Zt,Kt),selectionInactiveBackgroundTransparent:Kt,selectionInactiveBackgroundOpaque:re.blend(Zt,Kt),scrollbarSliderBackground:re.opacity(wt,.2),scrollbarSliderHoverBackground:re.opacity(wt,.4),scrollbarSliderActiveBackground:re.opacity(wt,.5),overviewRulerBorder:wt,ansi:pe.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=te(e.foreground,wt),t.background=te(e.background,Zt),t.cursor=re.blend(t.background,te(e.cursor,en)),t.cursorAccent=re.blend(t.background,te(e.cursorAccent,tn)),t.selectionBackgroundTransparent=te(e.selectionBackground,Kt),t.selectionBackgroundOpaque=re.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=te(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=re.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?te(e.selectionForeground,jr):void 0,t.selectionForeground===jr&&(t.selectionForeground=void 0),re.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=re.opacity(t.selectionBackgroundTransparent,.3)),re.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=re.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=te(e.scrollbarSliderBackground,re.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=te(e.scrollbarSliderHoverBackground,re.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=te(e.scrollbarSliderActiveBackground,re.opacity(t.foreground,.5)),t.overviewRulerBorder=te(e.overviewRulerBorder,Au),t.ansi=pe.slice(),t.ansi[0]=te(e.black,pe[0]),t.ansi[1]=te(e.red,pe[1]),t.ansi[2]=te(e.green,pe[2]),t.ansi[3]=te(e.yellow,pe[3]),t.ansi[4]=te(e.blue,pe[4]),t.ansi[5]=te(e.magenta,pe[5]),t.ansi[6]=te(e.cyan,pe[6]),t.ansi[7]=te(e.white,pe[7]),t.ansi[8]=te(e.brightBlack,pe[8]),t.ansi[9]=te(e.brightRed,pe[9]),t.ansi[10]=te(e.brightGreen,pe[10]),t.ansi[11]=te(e.brightYellow,pe[11]),t.ansi[12]=te(e.brightBlue,pe[12]),t.ansi[13]=te(e.brightMagenta,pe[13]),t.ansi[14]=te(e.brightCyan,pe[14]),t.ansi[15]=te(e.brightWhite,pe[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;sn.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(o)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},Ou={trace:0,debug:1,info:2,warn:3,error:4,off:5},$u="xterm.js: ",Vs=class extends G{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Ou[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis._length)for(let t=this._length;t=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;sthis._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*X+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*X+0]=t|2097152|i[2]<<22):this._data[t*X+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*X+0]>>22}hasWidth(t){return this._data[t*X+0]&12582912}getFg(t){return this._data[t*X+1]}getBg(t){return this._data[t*X+2]}hasContent(t){return this._data[t*X+0]&4194303}getCodePoint(t){let i=this._data[t*X+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*X+0]&2097152}getString(t){let i=this._data[t*X+0];return i&2097152?this._combined[t]:i&2097151?ft(i&2097151):""}isProtected(t){return this._data[t*X+2]&536870912}loadCell(t,i){return Si=t*X,i.content=this._data[Si+0],i.fg=this._data[Si+1],i.bg=this._data[Si+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*X+0]=i.content,this._data[t*X+1]=i.fg,this._data[t*X+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*X+0]=i|s<<22,this._data[t*X+1]=r.fg,this._data[t*X+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*X+0];r&2097152?this._combined[t]+=ft(i):r&2097151?(this._combined[t]=ft(r&2097151)+ft(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*X+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;nthis.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let o=0;o=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*ss=0;--t)if(this._data[t*X+0]&4194303)return t+(this._data[t*X+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*X+0]&4194303||this._data[t*X+2]&50331648)return t+(this._data[t*X+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let o=t._data;if(n)for(let h=r-1;h>=0;h--){for(let l=0;l=i&&(this._combined[l-i+s]=t._combined[l])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i>22||1}return r&&r.push(i),n}};function Hu(e,t,i,s,r,n){let o=[];for(let a=0;a=a&&s0&&(C>c||d[C].getTrimmedLength()===0);C--)m++;m>0&&(o.push(a+d.length-m),o.push(m)),a+=d.length-1}return o}function Fu(e,t){let i=[],s=0,r=t[s],n=0;for(let o=0;ooi(e,l,t)).reduce((h,l)=>h+l),n=0,o=0,a=0;for(;ah&&(n-=h,o++);let l=e[o].getWidth(n-1)===2;l&&n--;let d=l?i-1:i;s.push(d),a+=d}return s}function oi(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var Io=class No{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=No._nextId++,this._onDispose=this.register(new T),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Mt(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Io._nextId=1;var Uu=Io,me={},yt=me.B;me[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};me.A={"#":"£"};me.B=void 0;me[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};me.C=me[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};me.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};me.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};me.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};me.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};me.E=me[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};me.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};me.H=me[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};me["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var rn=4294967295,nn=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=de.clone(),this.savedCharset=yt,this.markers=[],this._nullCell=Ve.fromCharData([0,Jn,1,0]),this._whitespaceCell=Ve.fromCharData([0,pt,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new $i,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new sn(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ai),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ai),this._whitespaceCell}getBlankLine(e,t){return new Jt(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&ern?rn:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=de);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new sn(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(de),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new Jt(e,i)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=Hu(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(de),i);if(s.length>0){let r=Fu(this.lines,s);zu(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(de),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let h=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),h.unshift(a);if(!i){let N=this.ybase+this.y;if(N>=o&&N0&&(r.push({start:o+h.length+n,newLines:v}),n+=v.length),h.push(...v);let _=d.length-1,m=d[_];m===0&&(_--,m=d[_]);let C=h.length-c-1,M=l;for(;C>=0;){let N=Math.min(M,m);if(h[_]===void 0)break;if(h[_].copyCellsFrom(h[C],M-N,m-N,N,!0),m-=N,m===0&&(_--,m=d[_]),M-=N,M===0){C--;let f=Math.max(C,0);M=oi(h,f,this._cols)}}for(let N=0;N0;)this.ybase===0?this.y0){let o=[],a=[];for(let m=0;m=0;m--)if(c&&c.start>l+u){for(let C=c.newLines.length-1;C>=0;C--)this.lines.set(m--,c.newLines[C]);m++,o.push({index:l+1,amount:c.newLines.length}),u+=c.newLines.length,c=r[++d]}else this.lines.set(m,a[l--]);let v=0;for(let m=o.length-1;m>=0;m--)o[m].index+=v,this.lines.onInsertEmitter.fire(o[m]),v+=o[m].amount;let _=Math.max(0,h+n-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.linei.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Vu=class extends G{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new T),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new nn(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new nn(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Oo=2,$o=1,Ks=class extends G{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new T),this.onResize=this._onResize.event,this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Oo),this.rows=Math.max(e.rawOptions.rows||0,$o),this.buffers=this._register(new Vu(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};Ks=he([$(0,Pe)],Ks);var Tt={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Oi,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Ku=["normal","bold","100","200","300","400","500","600","700","800","900"],qu=class extends G{constructor(e){super(),this._onOptionChange=this._register(new T),this.onOptionChange=this._onOptionChange.event;let t={...Tt};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ne(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Tt))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Tt))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Tt[e]),!Yu(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Tt[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Ku.includes(t)?t:Tt[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function Yu(e){return e==="block"||e==="underline"||e==="bar"}function Qt(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&Qt(e[s],t-1);return i}var on=Object.freeze({insertMode:!1}),an=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),qs=class extends G{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new T),this.onData=this._onData.event,this._onUserInput=this._register(new T),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new T),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new T),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Qt(on),this.decPrivateModes=Qt(an)}reset(){this.modes=Qt(on),this.decPrivateModes=Qt(an)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};qs=he([$(0,Le),$(1,so),$(2,Pe)],qs);var ln={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function rs(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var ns=String.fromCharCode,hn={DEFAULT:e=>{let t=[rs(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${ns(t[0])}${ns(t[1])}${ns(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${rs(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${rs(e,!0)};${e.x};${e.y}${t}`}},Ys=class extends G{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new T),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(ln))this.addProtocol(s,ln[s]);for(let s of Object.keys(hn))this.addEncoding(s,hn[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Ys=he([$(0,Le),$(1,Lt),$(2,Pe)],Ys);var os=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],ju=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],ge;function Xu(e,t){let i=0,s=t.length-1,r;if(et[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=xt.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return xt.createPropertyValue(0,i,s)}},xt=class Li{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new T,this.onChange=this._onChange.event;let t=new Gu;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n=r)return i+this.wcwidth(o);let l=t.charCodeAt(n);56320<=l&&l<=57343?o=(o-55296)*1024+l-56320+65536:i+=this.wcwidth(l)}let a=this.charProperties(o,s),h=Li.extractWidth(a);Li.extractShouldJoin(a)&&(h-=Li.extractWidth(s)),i+=h,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},Zu=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function cn(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var qt=2147483647,Ju=256,Ho=class js{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>Ju)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new js;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>qt?qt:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>qt?qt:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,qt):t}},Yt=[],Qu=class{constructor(){this._state=0,this._active=Yt,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yt}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Yt,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Yt,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",zi(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Yt,this._id=-1,this._state=0}}},$e=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=zi(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},jt=[],e_=class{constructor(){this._handlers=Object.create(null),this._active=jt,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=jt}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=jt,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||jt,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",zi(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=jt,this._ident=0}},ei=new Ho;ei.addParam(0);var dn=class{constructor(e){this._handler=e,this._data="",this._params=ei,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ei,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=zi(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ei,this._data="",this._hitLimit=!1,i));return this._params=ei,this._data="",this._hitLimit=!1,t}},t_=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;rh),i=(a,h)=>t.slice(a,h),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;e.setDefault(1,0),e.addMany(s,0,2,0);for(o in n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ue,0,2,0),e.add(Ue,8,5,8),e.add(Ue,6,0,6),e.add(Ue,11,0,11),e.add(Ue,13,13,13),e})(),s_=class extends G{constructor(e=i_){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new Ho,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ne(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Qu),this._dcsParser=this._register(new e_),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;rn||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&h>-1){for(;h>=0&&(o=a[h](this._params),o!==!0);h--)if(o instanceof Promise)return this._parseStack.handlerPos=h,o}this._parseStack.handlers=[];break;case 4:if(i===!1&&h>-1){for(;h>=0&&(o=a[h](),o!==!0);h--)if(o instanceof Promise)return this._parseStack.handlerPos=h,o}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],o=this._oscParser.end(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a>4){case 2:for(let u=a+1;;++u){if(u>=t||(s=e[u])<32||s>126&&s=t||(s=e[u])<32||s>126&&s=t||(s=e[u])<32||s>126&&s=t||(s=e[u])<32||s>126&&s=0&&(o=h[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(3,h,l,r,a),o;l<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let d=this._escHandlers[this._collect<<8|s],c=d?d.length-1:-1;for(;c>=0&&(o=d[c](),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(4,d,c,r,a),o;c<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let u=a+1;;++u)if(u>=t||(s=e[u])===24||s===26||s===27||s>127&&s=t||(s=e[u])<32||s>127&&s>4:n>>8}return s}}function as(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function o_(e,t=16){let[i,s,r]=e;return`rgb:${as(i,t)}/${as(s,t)}/${as(r,t)}`}var a_={"(":0,")":1,"*":2,"+":3,"-":1,".":2},_t=131072,_n=10;function fn(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var pn=5e3,gn=0,l_=class extends G{constructor(e,t,i,s,r,n,o,a,h=new s_){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=a,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new Bc,this._utf8Decoder=new Dc,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=de.clone(),this._eraseAttrDataInternal=de.clone(),this._onRequestBell=this._register(new T),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new T),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new T),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new T),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new T),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new T),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new T),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new T),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new T),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new T),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new T),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new T),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Xs(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(l=>this._activeBuffer=l.activeBuffer)),this._parser.setCsiHandlerFallback((l,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(l),params:d.toArray()})}),this._parser.setEscHandlerFallback(l=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(l)})}),this._parser.setExecuteHandlerFallback(l=>{this._logService.debug("Unknown EXECUTE code: ",{code:l})}),this._parser.setOscHandlerFallback((l,d,c)=>{this._logService.debug("Unknown OSC code: ",{identifier:l,action:d,data:c})}),this._parser.setDcsHandlerFallback((l,d,c)=>{d==="HOOK"&&(c=c.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(l),action:d,payload:c})}),this._parser.setPrintHandler((l,d,c)=>this.print(l,d,c)),this._parser.registerCsiHandler({final:"@"},l=>this.insertChars(l)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},l=>this.scrollLeft(l)),this._parser.registerCsiHandler({final:"A"},l=>this.cursorUp(l)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},l=>this.scrollRight(l)),this._parser.registerCsiHandler({final:"B"},l=>this.cursorDown(l)),this._parser.registerCsiHandler({final:"C"},l=>this.cursorForward(l)),this._parser.registerCsiHandler({final:"D"},l=>this.cursorBackward(l)),this._parser.registerCsiHandler({final:"E"},l=>this.cursorNextLine(l)),this._parser.registerCsiHandler({final:"F"},l=>this.cursorPrecedingLine(l)),this._parser.registerCsiHandler({final:"G"},l=>this.cursorCharAbsolute(l)),this._parser.registerCsiHandler({final:"H"},l=>this.cursorPosition(l)),this._parser.registerCsiHandler({final:"I"},l=>this.cursorForwardTab(l)),this._parser.registerCsiHandler({final:"J"},l=>this.eraseInDisplay(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},l=>this.eraseInDisplay(l,!0)),this._parser.registerCsiHandler({final:"K"},l=>this.eraseInLine(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},l=>this.eraseInLine(l,!0)),this._parser.registerCsiHandler({final:"L"},l=>this.insertLines(l)),this._parser.registerCsiHandler({final:"M"},l=>this.deleteLines(l)),this._parser.registerCsiHandler({final:"P"},l=>this.deleteChars(l)),this._parser.registerCsiHandler({final:"S"},l=>this.scrollUp(l)),this._parser.registerCsiHandler({final:"T"},l=>this.scrollDown(l)),this._parser.registerCsiHandler({final:"X"},l=>this.eraseChars(l)),this._parser.registerCsiHandler({final:"Z"},l=>this.cursorBackwardTab(l)),this._parser.registerCsiHandler({final:"`"},l=>this.charPosAbsolute(l)),this._parser.registerCsiHandler({final:"a"},l=>this.hPositionRelative(l)),this._parser.registerCsiHandler({final:"b"},l=>this.repeatPrecedingCharacter(l)),this._parser.registerCsiHandler({final:"c"},l=>this.sendDeviceAttributesPrimary(l)),this._parser.registerCsiHandler({prefix:">",final:"c"},l=>this.sendDeviceAttributesSecondary(l)),this._parser.registerCsiHandler({final:"d"},l=>this.linePosAbsolute(l)),this._parser.registerCsiHandler({final:"e"},l=>this.vPositionRelative(l)),this._parser.registerCsiHandler({final:"f"},l=>this.hVPosition(l)),this._parser.registerCsiHandler({final:"g"},l=>this.tabClear(l)),this._parser.registerCsiHandler({final:"h"},l=>this.setMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"h"},l=>this.setModePrivate(l)),this._parser.registerCsiHandler({final:"l"},l=>this.resetMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"l"},l=>this.resetModePrivate(l)),this._parser.registerCsiHandler({final:"m"},l=>this.charAttributes(l)),this._parser.registerCsiHandler({final:"n"},l=>this.deviceStatus(l)),this._parser.registerCsiHandler({prefix:"?",final:"n"},l=>this.deviceStatusPrivate(l)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},l=>this.softReset(l)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},l=>this.setCursorStyle(l)),this._parser.registerCsiHandler({final:"r"},l=>this.setScrollRegion(l)),this._parser.registerCsiHandler({final:"s"},l=>this.saveCursor(l)),this._parser.registerCsiHandler({final:"t"},l=>this.windowOptions(l)),this._parser.registerCsiHandler({final:"u"},l=>this.restoreCursor(l)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},l=>this.insertColumns(l)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},l=>this.deleteColumns(l)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},l=>this.selectProtected(l)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},l=>this.requestMode(l,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},l=>this.requestMode(l,!1)),this._parser.setExecuteHandler(y.BEL,()=>this.bell()),this._parser.setExecuteHandler(y.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(y.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(y.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(y.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(y.BS,()=>this.backspace()),this._parser.setExecuteHandler(y.HT,()=>this.tab()),this._parser.setExecuteHandler(y.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(y.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Mi.IND,()=>this.index()),this._parser.setExecuteHandler(Mi.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Mi.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new $e(l=>(this.setTitle(l),this.setIconName(l),!0))),this._parser.registerOscHandler(1,new $e(l=>this.setIconName(l))),this._parser.registerOscHandler(2,new $e(l=>this.setTitle(l))),this._parser.registerOscHandler(4,new $e(l=>this.setOrReportIndexedColor(l))),this._parser.registerOscHandler(8,new $e(l=>this.setHyperlink(l))),this._parser.registerOscHandler(10,new $e(l=>this.setOrReportFgColor(l))),this._parser.registerOscHandler(11,new $e(l=>this.setOrReportBgColor(l))),this._parser.registerOscHandler(12,new $e(l=>this.setOrReportCursorColor(l))),this._parser.registerOscHandler(104,new $e(l=>this.restoreIndexedColor(l))),this._parser.registerOscHandler(110,new $e(l=>this.restoreFgColor(l))),this._parser.registerOscHandler(111,new $e(l=>this.restoreBgColor(l))),this._parser.registerOscHandler(112,new $e(l=>this.restoreCursorColor(l))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let l in me)this._parser.registerEscHandler({intermediates:"(",final:l},()=>this.selectCharset("("+l)),this._parser.registerEscHandler({intermediates:")",final:l},()=>this.selectCharset(")"+l)),this._parser.registerEscHandler({intermediates:"*",final:l},()=>this.selectCharset("*"+l)),this._parser.registerEscHandler({intermediates:"+",final:l},()=>this.selectCharset("+"+l)),this._parser.registerEscHandler({intermediates:"-",final:l},()=>this.selectCharset("-"+l)),this._parser.registerEscHandler({intermediates:".",final:l},()=>this.selectCharset("."+l)),this._parser.registerEscHandler({intermediates:"/",final:l},()=>this.selectCharset("/"+l));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(l=>(this._logService.error("Parsing error: ",l),l)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new dn((l,d)=>this.requestStatusString(l,d)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),pn))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${pn} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>_t&&(n=this._parseStack.position+_t)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,l=>String.fromCharCode(l)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(l=>l.charCodeAt(0)):e),this._parseBuffer.length_t)for(let l=n;l0&&c.getWidth(this._activeBuffer.x-1)===2&&c.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let u=this._parser.precedingJoinState;for(let v=t;va){if(h){let M=c,F=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&c instanceof Jt&&c.copyCellsFrom(M,F,0,C,!1);F=0;)c.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(l&&(c.insertCells(this._activeBuffer.x,r-C,this._activeBuffer.getNullCell(d)),c.getWidth(a-1)===2&&c.setCellFromCodepoint(a-1,0,1,d)),c.setCellFromCodepoint(this._activeBuffer.x++,s,r,d),r>0)for(;--r;)c.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=u,this._activeBuffer.x0&&c.getWidth(this._activeBuffer.x)===0&&!c.hasContent(this._activeBuffer.x)&&c.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>fn(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new dn(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new $e(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let h=a;for(let l=1;l0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(y.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(y.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(y.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(y.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(y.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t(m[m.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",m[m.SET=1]="SET",m[m.RESET=2]="RESET",m[m.PERMANENTLY_SET=3]="PERMANENTLY_SET",m[m.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:h}=this._bufferService,{active:l,alt:d}=a,c=this._optionsService.rawOptions,u=(m,C)=>(o.triggerDataEvent(`${y.ESC}[${t?"":"?"}${m};${C}$y`),!0),v=m=>m?1:2,_=e.params[0];return t?_===2?u(_,4):_===4?u(_,v(o.modes.insertMode)):_===12?u(_,3):_===20?u(_,v(c.convertEol)):u(_,0):_===1?u(_,v(s.applicationCursorKeys)):_===3?u(_,c.windowOptions.setWinLines?h===80?2:h===132?1:0:0):_===6?u(_,v(s.origin)):_===7?u(_,v(s.wraparound)):_===8?u(_,3):_===9?u(_,v(r==="X10")):_===12?u(_,v(c.cursorBlink)):_===25?u(_,v(!o.isCursorHidden)):_===45?u(_,v(s.reverseWraparound)):_===66?u(_,v(s.applicationKeypad)):_===67?u(_,4):_===1e3?u(_,v(r==="VT200")):_===1002?u(_,v(r==="DRAG")):_===1003?u(_,v(r==="ANY")):_===1004?u(_,v(s.sendFocus)):_===1005?u(_,4):_===1006?u(_,v(n==="SGR")):_===1015?u(_,4):_===1016?u(_,v(n==="SGR_PIXELS")):_===1048?u(_,1):_===47||_===1047||_===1049?u(_,v(l===d)):_===2004?u(_,v(s.bracketedPasteMode)):_===2026?u(_,v(s.synchronizedOutput)):u(_,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=ai.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let o=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=o[a];while(++a=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=de.fg,e.bg=de.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=de.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=de.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=de.fg&16777215,s.bg&=-67108864,s.bg|=de.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${y.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${y.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${y.ESC}[?${t};${i}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=de.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!fn(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${y.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>_n&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>_n&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(vn(n))if(r==="?")t.push({type:0,index:n});else{let o=un(r);o&&t.push({type:1,index:n,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=un(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=de.clone(),this._eraseAttrDataInternal=de.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Ve;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${y.ESC}${o}${y.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Xs=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(gn=e,e=t,t=gn),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Xs=he([$(0,Le)],Xs);function vn(e){return 0<=e&&e<256}var h_=5e7,mn=12,c_=50,d_=class extends G{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new T),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>h_)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let o=a=>performance.now()-i>=mn?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=mn)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>c_&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Gs=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(h,a)),this._dataByLinkId.set(h.id,h),h.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Gs=he([$(0,Le)],Gs);var bn=!1,u_=class extends G{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Nt),this._onBinary=this._register(new T),this.onBinary=this._onBinary.event,this._onData=this._register(new T),this.onData=this._onData.event,this._onLineFeed=this._register(new T),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new T),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new T),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new T),this._instantiationService=new Nu,this.optionsService=this._register(new qu(e)),this._instantiationService.setService(Pe,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Ks)),this._instantiationService.setService(Le,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Vs)),this._instantiationService.setService(so,this._logService),this.coreService=this._register(this._instantiationService.createInstance(qs)),this._instantiationService.setService(Lt,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ys)),this._instantiationService.setService(io,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(xt)),this._instantiationService.setService(Pc,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Zu),this._instantiationService.setService(Lc,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Gs),this._instantiationService.setService(ro,this._oscLinkService),this._inputHandler=this._register(new l_(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ke.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ke.forward(this._bufferService.onResize,this._onResize)),this._register(ke.forward(this.coreService.onData,this._onData)),this._register(ke.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new d_((t,i)=>this._inputHandler.parse(t,i))),this._register(ke.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new T),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!bn&&(this._logService.warn("writeSync is unreliable and will be removed soon."),bn=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Oo),t=Math.max(t,$o),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(cn.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(cn(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ne(()=>{for(let t of e)t.dispose()})}}},__={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function f_(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=y.ESC+"OA":r.key=y.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=y.ESC+"OD":r.key=y.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=y.ESC+"OC":r.key=y.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=y.ESC+"OB":r.key=y.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":y.DEL,e.altKey&&(r.key=y.ESC+r.key);break;case 9:if(e.shiftKey){r.key=y.ESC+"[Z";break}r.key=y.HT,r.cancel=!0;break;case 13:r.key=e.altKey?y.ESC+y.CR:y.CR,r.cancel=!0;break;case 27:r.key=y.ESC,e.altKey&&(r.key=y.ESC+y.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"D":t?r.key=y.ESC+"OD":r.key=y.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"C":t?r.key=y.ESC+"OC":r.key=y.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"A":t?r.key=y.ESC+"OA":r.key=y.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"B":t?r.key=y.ESC+"OB":r.key=y.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=y.ESC+"[2~");break;case 46:n?r.key=y.ESC+"[3;"+(n+1)+"~":r.key=y.ESC+"[3~";break;case 36:n?r.key=y.ESC+"[1;"+(n+1)+"H":t?r.key=y.ESC+"OH":r.key=y.ESC+"[H";break;case 35:n?r.key=y.ESC+"[1;"+(n+1)+"F":t?r.key=y.ESC+"OF":r.key=y.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=y.ESC+"[5;"+(n+1)+"~":r.key=y.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=y.ESC+"[6;"+(n+1)+"~":r.key=y.ESC+"[6~";break;case 112:n?r.key=y.ESC+"[1;"+(n+1)+"P":r.key=y.ESC+"OP";break;case 113:n?r.key=y.ESC+"[1;"+(n+1)+"Q":r.key=y.ESC+"OQ";break;case 114:n?r.key=y.ESC+"[1;"+(n+1)+"R":r.key=y.ESC+"OR";break;case 115:n?r.key=y.ESC+"[1;"+(n+1)+"S":r.key=y.ESC+"OS";break;case 116:n?r.key=y.ESC+"[15;"+(n+1)+"~":r.key=y.ESC+"[15~";break;case 117:n?r.key=y.ESC+"[17;"+(n+1)+"~":r.key=y.ESC+"[17~";break;case 118:n?r.key=y.ESC+"[18;"+(n+1)+"~":r.key=y.ESC+"[18~";break;case 119:n?r.key=y.ESC+"[19;"+(n+1)+"~":r.key=y.ESC+"[19~";break;case 120:n?r.key=y.ESC+"[20;"+(n+1)+"~":r.key=y.ESC+"[20~";break;case 121:n?r.key=y.ESC+"[21;"+(n+1)+"~":r.key=y.ESC+"[21~";break;case 122:n?r.key=y.ESC+"[23;"+(n+1)+"~":r.key=y.ESC+"[23~";break;case 123:n?r.key=y.ESC+"[24;"+(n+1)+"~":r.key=y.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=y.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=y.DEL:e.keyCode===219?r.key=y.ESC:e.keyCode===220?r.key=y.FS:e.keyCode===221&&(r.key=y.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let o=__[e.keyCode]?.[e.shiftKey?1:0];if(o)r.key=y.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(a);e.shiftKey&&(h=h.toUpperCase()),r.key=y.ESC+h}else if(e.keyCode===32)r.key=y.ESC+(e.ctrlKey?y.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=y.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=y.US),e.key==="@"&&(r.key=y.NUL));break}return r}var ce=0,p_=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new $i,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new $i,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ce=this._search(t),ce===-1)||this._getKey(this._array[ce])!==t)return!1;do if(this._array[ce]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ce),!0;while(++cer-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ce=this._search(e),!(ce<0||ce>=this._array.length)&&this._getKey(this._array[ce])===e))do yield this._array[ce];while(++ce=this._array.length)&&this._getKey(this._array[ce])===e))do t(this._array[ce]);while(++ce=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},ls=0,Sn=0,g_=class extends G{constructor(){super(),this._decorations=new p_(e=>e?.marker.line),this._onDecorationRegistered=this._register(new T),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new T),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ne(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new v_(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e{ls=r.options.x??0,Sn=ls+(r.options.width??1),e>=ls&&e=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},wn=20,Hi=class extends G{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;nthis._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new b_(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` -`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(V(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ne(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` -`&&(this._liveRegionLineCount++,this._liveRegionLineCount===wn+1&&(this._liveRegion.textContent+=gs.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),o=[],a=n?.translateToString(!0,void 0,void 0,o)||"",h=(i.ydisp+r+1).toString(),l=this._rowElements[r];l&&(a.length===0?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=a,this._rowColumns.set(l,o)),l.setAttribute("aria-posinset",h),l.setAttribute("aria-setsize",s),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let o,a;if(t===0?(o=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:h})=>{let l=a instanceof Text?a.parentNode:a,d=parseInt(l?.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let c=this._rowColumns.get(l);if(!c)return console.warn("columns is null. Race condition?"),null;let u=h=this._terminal.cols&&(++d,u=0),{row:d,column:u}},n=r(t),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{Mt(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(V(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(V(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(V(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(V(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let o=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;se?this._bufferService.cols:o.link.range.end.x;for(let l=a;l<=h;l++){if(i.has(l)){r.splice(n--,1);break}i.add(l)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;nthis._linkAtPosition(o.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;nthis._linkAtPosition(a.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&S_(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Mt(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};Zs=he([$(1,cr),$(2,lt),$(3,Le),$(4,oo)],Zs);function S_(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var w_=class extends u_{constructor(e={}){super(e),this._linkifier=this._register(new Nt),this.browser=Eo,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Nt),this._onCursorMove=this._register(new T),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new T),this.onKey=this._onKey.event,this._onRender=this._register(new T),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new T),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new T),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new T),this.onBell=this._onBell.event,this._onFocus=this._register(new T),this._onBlur=this._register(new T),this._onA11yCharEmitter=this._register(new T),this._onA11yTabEmitter=this._register(new T),this._onWillOpen=this._register(new T),this._setup(),this._decorationService=this._instantiationService.createInstance(g_),this._instantiationService.setService(li,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(cu),this._instantiationService.setService(oo,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ms)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ke.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ke.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ke.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ke.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ne(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=re.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${y.ESC}]${s};${o_(r)}${ko.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=_e.toColor(...t.color));else{let n=i;this._themeService.modifyColors(o=>o[n]=_e.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Hi,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(y.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(y.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(V(this.element,"copy",t=>{this.hasSelection()&&xc(t,this._selectionService)}));let e=t=>Ec(t,this.textarea,this.coreService,this.optionsService);this._register(V(this.textarea,"paste",e)),this._register(V(this.element,"paste",e)),Bo?this._register(V(this.element,"mousedown",t=>{t.button===2&&Rr(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(V(this.element,"contextmenu",t=>{Rr(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),mr&&this._register(V(this.element,"auxclick",t=>{t.button===1&&Zn(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(V(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(V(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(V(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(V(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(V(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(V(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(V(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(V(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",ps.get()),Ro||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(lu,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(at,this._coreBrowserService),this._register(V(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(V(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Hs,this._document,this._helperContainer),this._instantiationService.setService(Wi,this._charSizeService),this._themeService=this._instantiationService.createInstance(Us),this._instantiationService.setService(Ft,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ni),this._instantiationService.setService(no,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(zs,this.rows,this.screenElement)),this._instantiationService.setService(lt,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Ns,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Fs),this._instantiationService.setService(cr,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(Zs,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(As,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ws,this.element,this.screenElement,s)),this._instantiationService.setService(Ac,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(ke.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Is,this.screenElement)),this._register(V(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Hi,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ii,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ii,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance($s,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let a,h;switch(n.overrideType||n.type){case"mousemove":h=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":h=0,a=n.button<3?n.button:3;break;case"mousedown":h=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let l=n.deltaY;if(l===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;h=l<0?0:1,a=4;break;default:return!1}return h===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:h,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(V(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(V(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let o=y.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Gn(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=f_(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===y.ETX||i.key===y.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(y_(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ve)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},yn=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new k_(t)}getNullCell(){return new Ve}},x_=class extends G{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new T),this.onBufferChange=this._onBufferChange.event,this._normal=new yn(this._core.buffers.normal,"normal"),this._alternate=new yn(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},E_=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},B_=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},D_=["cols","rows"],je=0,M_=class extends G{constructor(e){super(),this._core=this._register(new w_(e)),this._addonManager=this._register(new C_),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(D_.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new E_(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new B_(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new x_(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r -`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return ps.get()},set promptLabel(e){ps.set(e)},get tooMuchOutput(){return gs.get()},set tooMuchOutput(e){gs.set(e)}}}_verifyIntegers(...e){for(je of e)if(je===1/0||isNaN(je)||je%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(je of e)if(je&&(je===1/0||isNaN(je)||je%1!==0||je<0))throw new Error("This API only accepts positive integers")}};const R_={class:"flex min-h-0 flex-1 flex-col"},L_=fe({__name:"TerminalSession",props:{session:{},active:{type:Boolean}},emits:["titleChange","statusChange","exit"],setup(e,{emit:t}){const{t:i}=Ot(),s=e,r=t,n=q("#000000"),o=q({ctrl:"off",alt:"off"}),a=vc(),h=Q(()=>s.active&&a.value>100),l=Q(()=>({background:n.value})),d=er("terminalEl");let c=null,u=null,v=null,_=null,m=null;const C=new TextEncoder,M={ctrl:0,alt:0},F=D=>r("statusChange",D),N=()=>{const w=getComputedStyle(document.body).backgroundColor.match(/\d+(\.\d+)?/g);if(!w||w.length<3)return!0;const[S,z,Z]=w.map(Number);return .299*S+.587*z+.114*Z<128},f=()=>{const D=gc(Ie.value,N());return n.value=D.background??"#000000",D},R=()=>{c&&(c.options.theme=f(),c.options.fontFamily=xr(Ie.value),c.options.fontSize=Er(Ie.value),u?.fit())},B=D=>{m?.send({message:{case:"input",value:{data:C.encode(D)}}})},U=D=>{const w=Date.now(),S=w-M[D]<300;M[D]=w,o.value=rc(o.value,D,S),c?.focus()},L=D=>{let w=null;D.kind==="special"?w=tc(D.id,o.value):D.kind==="text"&&(w=Cr(D.char,o.value)),w!==null&&B(w),o.value=Xi(o.value),c?.focus()},K=()=>{navigator.clipboard?.readText?.().then(D=>{D&&B(D)},()=>{}),o.value=Xi(o.value),c?.focus()};let I=0,H=0;const k=D=>{D.touches.length===1&&(I=D.touches[0].clientY,H=0)},b=D=>{if(D.touches.length!==1||!c||!d.value)return;const w=D.touches[0].clientY;H+=I-w,I=w;const S=d.value.clientHeight/c.rows||20,z=Math.trunc(H/S);z!==0&&(H-=z*S,c.buffer.active.type==="alternate"?B((z>0?"\x1B[B":"\x1B[A").repeat(Math.abs(z))):c.scrollLines(z)),D.preventDefault()},P=()=>{const D=Rn.value,w=D?Ln(D):"";if(!w||!d.value)return;F(i("connecting")),c=new M_({fontSize:Er(Ie.value),fontFamily:xr(Ie.value),cursorBlink:!0,theme:f()}),u=new Sc,c.loadAddon(u),c.open(d.value),u.fit(),c.focus(),d.value.addEventListener("touchstart",k,{passive:!0}),d.value.addEventListener("touchmove",b,{passive:!1}),v=new ResizeObserver(()=>{d.value&&d.value.clientWidth>0&&d.value.clientHeight>0&&u?.fit()}),v.observe(d.value),_=new MutationObserver(R),_.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let S=!1,z=null;m=new In({baseUrl:w,secret:D?Pn(D):"",service:"daemon.StartedService",method:"StartTailscaleSSHSession",requestSchema:Go,responseSchema:Xo,onMessage:Z=>{const se=Z.message;switch(se.case){case"authBanner":c?.write(se.value.message.replaceAll(` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),Sr&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s||!t?!1:this._areCoordsInSelection(t,i,s)}isCellInSelection(e,t){let i=this._model.finalSelectionStart,s=this._model.finalSelectionEnd;return!i||!s?!1:this._areCoordsInSelection([e,t],i,s)}_areCoordsInSelection(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]}_selectWordAtCursor(e,t){let i=this._linkifier.currentLink?.link?.range;if(i)return this._model.selectionStart=[i.start.x-1,i.start.y-1],this._model.selectionStartLength=Qr(i,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let s=this._getMouseBufferCoords(e);return s?(this._selectWordAt(s,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=br(this._coreBrowserService.window,e,this._screenElement)[1],i=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=i?0:(t>i&&(t-=i),t=Math.min(Math.max(t,-is),is),t/=is,t/Math.abs(t)+Math.round(t*(Bu-1)))}shouldForceSelection(e){return Oi?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),Du)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(Oi&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let i=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&tthis._handleTrim(t))}_convertViewportColToCharacterIndex(e,t){let i=t;for(let s=0;t>=s;s++){let r=e.loadCell(s,this._workCell).getChars().length;this._workCell.getWidth()===0?i--:r>1&&t!==s&&(i+=r-1)}return i}setSelection(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,i=!0,s=!0){if(e[0]>=this._bufferService.cols)return;let r=this._bufferService.buffer,n=r.lines.get(e[1]);if(!n)return;let o=r.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(n,e[0]),h=a,l=e[0]-a,d=0,c=0,u=0,v=0;if(o.charAt(a)===" "){for(;a>0&&o.charAt(a-1)===" ";)a--;for(;h1&&(v+=H-1,h+=H-1);C>0&&a>0&&!this._isCharWordSeparator(n.loadCell(C-1,this._workCell));){n.loadCell(C-1,this._workCell);let I=this._workCell.getChars().length;this._workCell.getWidth()===0?(d++,C--):I>1&&(u+=I-1,a-=I-1),a--,C--}for(;M1&&(v+=I-1,h+=I-1),h++,M++}}h++;let _=a+l-d+u,m=Math.min(this._bufferService.cols,h-a+d+c-u-v);if(!(!t&&o.slice(a,h).trim()==="")){if(i&&_===0&&n.getCodePoint(0)!==32){let C=r.lines.get(e[1]-1);if(C&&n.isWrapped&&C.getCodePoint(this._bufferService.cols-1)!==32){let M=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(M){let H=this._bufferService.cols-M.start;_-=H,m+=H}}}if(s&&_+m===this._bufferService.cols&&n.getCodePoint(this._bufferService.cols-1)!==32){let C=r.lines.get(e[1]+1);if(C?.isWrapped&&C.getCodePoint(0)!==32){let M=this._getWordAt([0,e[1]+1],!1,!1,!0);M&&(m+=M.length)}}return{start:_,length:m}}}_selectWordAt(e,t){let i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let i=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}}_isCharWordSeparator(e){return e.getWidth()===0?!1:this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),i={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=Qr(i,this._bufferService.cols)}};Ws=he([$(3,Le),$(4,Lt),$(5,ur),$(6,Pe),$(7,lt),$(8,at)],Ws);var en=class{constructor(){this._data={}}set(e,t,i){this._data[e]||(this._data[e]={}),this._data[e][t]=i}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},tn=class{constructor(){this._color=new en,this._css=new en}setCss(e,t,i){this._css.set(e,t,i)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,i){this._color.set(e,t,i)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},pe=Object.freeze((()=>{let e=[ae.toColor("#2e3436"),ae.toColor("#cc0000"),ae.toColor("#4e9a06"),ae.toColor("#c4a000"),ae.toColor("#3465a4"),ae.toColor("#75507b"),ae.toColor("#06989a"),ae.toColor("#d3d7cf"),ae.toColor("#555753"),ae.toColor("#ef2929"),ae.toColor("#8ae234"),ae.toColor("#fce94f"),ae.toColor("#729fcf"),ae.toColor("#ad7fa8"),ae.toColor("#34e2e2"),ae.toColor("#eeeeec")],t=[0,95,135,175,215,255];for(let i=0;i<216;i++){let s=t[i/36%6|0],r=t[i/6%6|0],n=t[i%6];e.push({css:_e.toCss(s,r,n),rgba:_e.toRgba(s,r,n)})}for(let i=0;i<24;i++){let s=8+i*10;e.push({css:_e.toCss(s,s,s),rgba:_e.toRgba(s,s,s)})}return e})()),wt=ae.toColor("#ffffff"),Zt=ae.toColor("#000000"),sn=ae.toColor("#ffffff"),rn=Zt,Kt={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117},Pu=wt,Us=class extends G{constructor(e){super(),this._optionsService=e,this._contrastCache=new tn,this._halfContrastCache=new tn,this._onChangeColors=this._register(new T),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:wt,background:Zt,cursor:sn,cursorAccent:rn,selectionForeground:void 0,selectionBackgroundTransparent:Kt,selectionBackgroundOpaque:re.blend(Zt,Kt),selectionInactiveBackgroundTransparent:Kt,selectionInactiveBackgroundOpaque:re.blend(Zt,Kt),scrollbarSliderBackground:re.opacity(wt,.2),scrollbarSliderHoverBackground:re.opacity(wt,.4),scrollbarSliderActiveBackground:re.opacity(wt,.5),overviewRulerBorder:wt,ansi:pe.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=te(e.foreground,wt),t.background=te(e.background,Zt),t.cursor=re.blend(t.background,te(e.cursor,sn)),t.cursorAccent=re.blend(t.background,te(e.cursorAccent,rn)),t.selectionBackgroundTransparent=te(e.selectionBackground,Kt),t.selectionBackgroundOpaque=re.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=te(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=re.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?te(e.selectionForeground,Gr):void 0,t.selectionForeground===Gr&&(t.selectionForeground=void 0),re.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=re.opacity(t.selectionBackgroundTransparent,.3)),re.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=re.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=te(e.scrollbarSliderBackground,re.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=te(e.scrollbarSliderHoverBackground,re.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=te(e.scrollbarSliderActiveBackground,re.opacity(t.foreground,.5)),t.overviewRulerBorder=te(e.overviewRulerBorder,Pu),t.ansi=pe.slice(),t.ansi[0]=te(e.black,pe[0]),t.ansi[1]=te(e.red,pe[1]),t.ansi[2]=te(e.green,pe[2]),t.ansi[3]=te(e.yellow,pe[3]),t.ansi[4]=te(e.blue,pe[4]),t.ansi[5]=te(e.magenta,pe[5]),t.ansi[6]=te(e.cyan,pe[6]),t.ansi[7]=te(e.white,pe[7]),t.ansi[8]=te(e.brightBlack,pe[8]),t.ansi[9]=te(e.brightRed,pe[9]),t.ansi[10]=te(e.brightGreen,pe[10]),t.ansi[11]=te(e.brightYellow,pe[11]),t.ansi[12]=te(e.brightBlue,pe[12]),t.ansi[13]=te(e.brightMagenta,pe[13]),t.ansi[14]=te(e.brightCyan,pe[14]),t.ansi[15]=te(e.brightWhite,pe[15]),e.extendedAnsi){let i=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let s=0;sn.index-o.index),s=[];for(let n of i){let o=this._services.get(n.id);if(!o)throw new Error(`[createInstance] ${e.name} depends on UNKNOWN service ${n.id._id}.`);s.push(o)}let r=i.length>0?i[0].index:t.length;if(t.length!==r)throw new Error(`[createInstance] First service dependency of ${e.name} at position ${r+1} conflicts with ${t.length} static arguments`);return new e(...t,...s)}},Iu={trace:0,debug:1,info:2,warn:3,error:4,off:5},Nu="xterm.js: ",Vs=class extends G{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=Iu[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;tthis._length)for(let t=this._length;t=e;s--)this._array[this._getCyclicIndex(s+i.length)]=this._array[this._getCyclicIndex(s)];for(let s=0;sthis._maxLength){let s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.onTrimEmitter.fire(s)}else this._length+=i.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(i>0){for(let r=t-1;r>=0;r--)this.set(e+r+i,this.get(e+r));let s=e+t+i-this._length;if(s>0)for(this._length+=s;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let s=0;s>22,i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):s]}set(t,i){this._data[t*X+1]=i[0],i[1].length>1?(this._combined[t]=i[1],this._data[t*X+0]=t|2097152|i[2]<<22):this._data[t*X+0]=i[1].charCodeAt(0)|i[2]<<22}getWidth(t){return this._data[t*X+0]>>22}hasWidth(t){return this._data[t*X+0]&12582912}getFg(t){return this._data[t*X+1]}getBg(t){return this._data[t*X+2]}hasContent(t){return this._data[t*X+0]&4194303}getCodePoint(t){let i=this._data[t*X+0];return i&2097152?this._combined[t].charCodeAt(this._combined[t].length-1):i&2097151}isCombined(t){return this._data[t*X+0]&2097152}getString(t){let i=this._data[t*X+0];return i&2097152?this._combined[t]:i&2097151?ft(i&2097151):""}isProtected(t){return this._data[t*X+2]&536870912}loadCell(t,i){return Si=t*X,i.content=this._data[Si+0],i.fg=this._data[Si+1],i.bg=this._data[Si+2],i.content&2097152&&(i.combinedData=this._combined[t]),i.bg&268435456&&(i.extended=this._extendedAttrs[t]),i}setCell(t,i){i.content&2097152&&(this._combined[t]=i.combinedData),i.bg&268435456&&(this._extendedAttrs[t]=i.extended),this._data[t*X+0]=i.content,this._data[t*X+1]=i.fg,this._data[t*X+2]=i.bg}setCellFromCodepoint(t,i,s,r){r.bg&268435456&&(this._extendedAttrs[t]=r.extended),this._data[t*X+0]=i|s<<22,this._data[t*X+1]=r.fg,this._data[t*X+2]=r.bg}addCodepointToCell(t,i,s){let r=this._data[t*X+0];r&2097152?this._combined[t]+=ft(i):r&2097151?(this._combined[t]=ft(r&2097151)+ft(i),r&=-2097152,r|=2097152):r=i|1<<22,s&&(r&=-12582913,r|=s<<22),this._data[t*X+0]=r}insertCells(t,i,s){if(t%=this.length,t&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t-1,0,1,s),i=0;--n)this.setCell(t+i+n,this.loadCell(t+n,r));for(let n=0;nthis.length){if(this._data.buffer.byteLength>=s*4)this._data=new Uint32Array(this._data.buffer,0,s);else{let r=new Uint32Array(s);r.set(this._data),this._data=r}for(let r=this.length;r=t&&delete this._combined[a]}let n=Object.keys(this._extendedAttrs);for(let o=0;o=t&&delete this._extendedAttrs[a]}}return this.length=t,s*4*ss=0;--t)if(this._data[t*X+0]&4194303)return t+(this._data[t*X+0]>>22);return 0}getNoBgTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(this._data[t*X+0]&4194303||this._data[t*X+2]&50331648)return t+(this._data[t*X+0]>>22);return 0}copyCellsFrom(t,i,s,r,n){let o=t._data;if(n)for(let h=r-1;h>=0;h--){for(let l=0;l=i&&(this._combined[l-i+s]=t._combined[l])}}translateToString(t,i,s,r){i=i??0,s=s??this.length,t&&(s=Math.min(s,this.getTrimmedLength())),r&&(r.length=0);let n="";for(;i>22||1}return r&&r.push(i),n}};function Ou(e,t,i,s,r,n){let o=[];for(let a=0;a=a&&s0&&(C>c||d[C].getTrimmedLength()===0);C--)m++;m>0&&(o.push(a+d.length-m),o.push(m)),a+=d.length-1}return o}function $u(e,t){let i=[],s=0,r=t[s],n=0;for(let o=0;ooi(e,l,t)).reduce((h,l)=>h+l),n=0,o=0,a=0;for(;ah&&(n-=h,o++);let l=e[o].getWidth(n-1)===2;l&&n--;let d=l?i-1:i;s.push(d),a+=d}return s}function oi(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();let s=!e[t].hasContent(i-1)&&e[t].getWidth(i-1)===1,r=e[t+1].getWidth(0)===2;return s&&r?i-1:i}var Oo=class $o{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=$o._nextId++,this._onDispose=this.register(new T),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),Mt(this._disposables),this._disposables.length=0)}register(t){return this._disposables.push(t),t}};Oo._nextId=1;var zu=Oo,me={},yt=me.B;me[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"};me.A={"#":"£"};me.B=void 0;me[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"};me.C=me[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};me.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"};me.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"};me.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"};me.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"};me.E=me[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"};me.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"};me.H=me[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"};me["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"};var on=4294967295,an=class{constructor(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=de.clone(),this.savedCharset=yt,this.markers=[],this._nullCell=Ve.fromCharData([0,eo,1,0]),this._whitespaceCell=Ve.fromCharData([0,pt,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new $i,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new nn(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new Ai),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new Ai),this._whitespaceCell}getBlankLine(e,t){return new Jt(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&eon?on:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=de);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new nn(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let i=this.getNullCell(de),s=0,r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+n+1?(this.ybase--,n++,this.ydisp>0&&this.ydisp--):this.lines.push(new Jt(e,i)));else for(let o=this._rows;o>t;o--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),n&&(this.y+=n),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let n=0;n.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend==="conpty"&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let i=this._optionsService.rawOptions.reflowCursorLine,s=Ou(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(de),i);if(s.length>0){let r=$u(this.lines,s);Hu(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}}_reflowLargerAdjustViewport(e,t,i){let s=this.getNullCell(de),r=i;for(;r-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;o--){let a=this.lines.get(o);if(!a||!a.isWrapped&&a.getTrimmedLength()<=e)continue;let h=[a];for(;a.isWrapped&&o>0;)a=this.lines.get(--o),h.unshift(a);if(!i){let I=this.ybase+this.y;if(I>=o&&I0&&(r.push({start:o+h.length+n,newLines:v}),n+=v.length),h.push(...v);let _=d.length-1,m=d[_];m===0&&(_--,m=d[_]);let C=h.length-c-1,M=l;for(;C>=0;){let I=Math.min(M,m);if(h[_]===void 0)break;if(h[_].copyCellsFrom(h[C],M-I,m-I,I,!0),m-=I,m===0&&(_--,m=d[_]),M-=I,M===0){C--;let f=Math.max(C,0);M=oi(h,f,this._cols)}}for(let I=0;I0;)this.ybase===0?this.y0){let o=[],a=[];for(let m=0;m=0;m--)if(c&&c.start>l+u){for(let C=c.newLines.length-1;C>=0;C--)this.lines.set(m--,c.newLines[C]);m++,o.push({index:l+1,amount:c.newLines.length}),u+=c.newLines.length,c=r[++d]}else this.lines.set(m,a[l--]);let v=0;for(let m=o.length-1;m>=0;m--)o[m].index+=v,this.lines.onInsertEmitter.fire(o[m]),v+=o[m].amount;let _=Math.max(0,h+n-this.lines.maxLength);_>0&&this.lines.onTrimEmitter.fire(_)}}translateBufferLineToString(e,t,i=0,s){let r=this.lines.get(e);return r?r.translateToString(t,i,s):""}getWrappedRangeForLine(e){let t=e,i=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;i+10;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t{t.line-=i,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(i=>{t.line>=i.index&&(t.line+=i.amount)})),t.register(this.lines.onDelete(i=>{t.line>=i.index&&t.linei.index&&(t.line-=i.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},Wu=class extends G{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new T),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new an(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new an(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},Ho=2,Fo=1,Ks=class extends G{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new T),this.onResize=this._onResize.event,this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,Ho),this.rows=Math.max(e.rawOptions.rows||0,Fo),this.buffers=this._register(new Wu(e,this)),this._register(this.buffers.onBufferActivate(t=>{this._onScroll.fire(t.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let i=this.cols!==e,s=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:i,rowsChanged:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let i=this.buffer,s;s=this._cachedBlankLine,(!s||s.length!==this.cols||s.getFg(0)!==e.fg||s.getBg(0)!==e.bg)&&(s=i.getBlankLine(e,t),this._cachedBlankLine=s),s.isWrapped=t;let r=i.ybase+i.scrollTop,n=i.ybase+i.scrollBottom;if(i.scrollTop===0){let o=i.lines.isFull;n===i.lines.length-1?o?i.lines.recycle().copyFrom(s):i.lines.push(s.clone()):i.lines.splice(n+1,0,s.clone()),o?this.isUserScrolling&&(i.ydisp=Math.max(i.ydisp-1,0)):(i.ybase++,this.isUserScrolling||i.ydisp++)}else{let o=n-r+1;i.lines.shiftElements(r+1,o-1,-1),i.lines.set(n,s.clone())}this.isUserScrolling||(i.ydisp=i.ybase),this._onScroll.fire(i.ydisp)}scrollLines(e,t){let i=this.buffer;if(e<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else e+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let s=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+e,i.ybase),0),s!==i.ydisp&&(t||this._onScroll.fire(i.ydisp))}};Ks=he([$(0,Pe)],Ks);var Tt={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:Oi,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRuler:{}},Uu=["normal","bold","100","200","300","400","500","600","700","800","900"],Vu=class extends G{constructor(e){super(),this._onOptionChange=this._register(new T),this.onOptionChange=this._onOptionChange.event;let t={...Tt};for(let i in e)if(i in t)try{let s=e[i];t[i]=this._sanitizeAndValidateOption(i,s)}catch(s){console.error(s)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(ne(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(i=>{i===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(i=>{e.indexOf(i)!==-1&&t()})}_setupOptions(){let e=i=>{if(!(i in Tt))throw new Error(`No option with key "${i}"`);return this.rawOptions[i]},t=(i,s)=>{if(!(i in Tt))throw new Error(`No option with key "${i}"`);s=this._sanitizeAndValidateOption(i,s),this.rawOptions[i]!==s&&(this.rawOptions[i]=s,this._onOptionChange.fire(i))};for(let i in this.rawOptions){let s={get:e.bind(this,i),set:t.bind(this,i)};Object.defineProperty(this.options,i,s)}}_sanitizeAndValidateOption(e,t){switch(e){case"cursorStyle":if(t||(t=Tt[e]),!Ku(t))throw new Error(`"${t}" is not a valid value for ${e}`);break;case"wordSeparator":t||(t=Tt[e]);break;case"fontWeight":case"fontWeightBold":if(typeof t=="number"&&1<=t&&t<=1e3)break;t=Uu.includes(t)?t:Tt[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(`${e} cannot be less than 1, value: ${t}`);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case"scrollback":if(t=Math.min(t,4294967295),t<0)throw new Error(`${e} cannot be less than 0, value: ${t}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case"rows":case"cols":if(!t&&t!==0)throw new Error(`${e} must be numeric, value: ${t}`);break;case"windowsPty":t=t??{};break}return t}};function Ku(e){return e==="block"||e==="underline"||e==="bar"}function Qt(e,t=5){if(typeof e!="object")return e;let i=Array.isArray(e)?[]:{};for(let s in e)i[s]=t<=1?e[s]:e[s]&&Qt(e[s],t-1);return i}var ln=Object.freeze({insertMode:!1}),hn=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),qs=class extends G{constructor(e,t,i){super(),this._bufferService=e,this._logService=t,this._optionsService=i,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new T),this.onData=this._onData.event,this._onUserInput=this._register(new T),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new T),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new T),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Qt(ln),this.decPrivateModes=Qt(hn)}reset(){this.modes=Qt(ln),this.decPrivateModes=Qt(hn)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let i=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&i.ybase!==i.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace("sending data (codes)",()=>e.split("").map(s=>s.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace("sending binary (codes)",()=>e.split("").map(t=>t.charCodeAt(0))),this._onBinary.fire(e))}};qs=he([$(0,Le),$(1,no),$(2,Pe)],qs);var cn={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>!(e.action===32&&e.button===3)},ANY:{events:31,restrict:e=>!0}};function rs(e,t){let i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(i|=64,i|=e.action):(i|=e.button&3,e.button&4&&(i|=64),e.button&8&&(i|=128),e.action===32?i|=32:e.action===0&&!t&&(i|=3)),i}var ns=String.fromCharCode,dn={DEFAULT:e=>{let t=[rs(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?"":`\x1B[M${ns(t[0])}${ns(t[1])}${ns(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${rs(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${rs(e,!0)};${e.x};${e.y}${t}`}},Ys=class extends G{constructor(e,t,i){super(),this._bufferService=e,this._coreService=t,this._optionsService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new T),this.onProtocolChange=this._onProtocolChange.event;for(let s of Object.keys(cn))this.addProtocol(s,cn[s]);for(let s of Object.keys(dn))this.addEncoding(s,dn[s]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,i){if(e.deltaY===0||e.shiftKey||t===void 0||i===void 0)return 0;let s=t/i,r=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=s+0,Math.abs(e.deltaY)<50&&(r*=.3),this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,i){if(i){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return!(e.button!==t.button||e.action!==t.action||e.ctrl!==t.ctrl||e.alt!==t.alt||e.shift!==t.shift)}};Ys=he([$(0,Le),$(1,Lt),$(2,Pe)],Ys);var os=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],qu=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],ge;function Yu(e,t){let i=0,s=t.length-1,r;if(et[s][1])return!1;for(;s>=i;)if(r=i+s>>1,e>t[r][1])i=r+1;else if(e=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let i=this.wcwidth(e),s=i===0&&t!==0;if(s){let r=xt.extractWidth(t);r===0?s=!1:r>i&&(i=r)}return xt.createPropertyValue(0,i,s)}},xt=class Li{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new T,this.onChange=this._onChange.event;let t=new ju;this.register(t),this._active=t.version,this._activeProvider=t}static extractShouldJoin(t){return(t&1)!==0}static extractWidth(t){return t>>1&3}static extractCharKind(t){return t>>3}static createPropertyValue(t,i,s=!1){return(t&16777215)<<3|(i&3)<<1|(s?1:0)}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(t){if(!this._providers[t])throw new Error(`unknown Unicode version "${t}"`);this._active=t,this._activeProvider=this._providers[t],this._onChange.fire(t)}register(t){this._providers[t.version]=t}wcwidth(t){return this._activeProvider.wcwidth(t)}getStringCellWidth(t){let i=0,s=0,r=t.length;for(let n=0;n=r)return i+this.wcwidth(o);let l=t.charCodeAt(n);56320<=l&&l<=57343?o=(o-55296)*1024+l-56320+65536:i+=this.wcwidth(l)}let a=this.charProperties(o,s),h=Li.extractWidth(a);Li.extractShouldJoin(a)&&(h-=Li.extractWidth(s)),i+=h,s=a}return i}charProperties(t,i){return this._activeProvider.charProperties(t,i)}},Xu=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function un(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),i=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);i&&t&&(i.isWrapped=t[3]!==0&&t[3]!==32)}var qt=2147483647,Gu=256,zo=class js{constructor(t=32,i=32){if(this.maxLength=t,this.maxSubParamsLength=i,i>Gu)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(t),this.length=0,this._subParams=new Int32Array(i),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(t),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let i=new js;if(!t.length)return i;for(let s=Array.isArray(t[0])?1:0;s>8,r=this._subParamsIdx[i]&255;r-s>0&&t.push(Array.prototype.slice.call(this._subParams,s,r))}return t}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(t){if(this._digitIsSub=!1,this.length>=this.maxLength){this._rejectDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=t>qt?qt:t}addSubParam(t){if(this._digitIsSub=!0,!!this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(t<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=t>qt?qt:t,this._subParamsIdx[this.length-1]++}}hasSubParams(t){return(this._subParamsIdx[t]&255)-(this._subParamsIdx[t]>>8)>0}getSubParams(t){let i=this._subParamsIdx[t]>>8,s=this._subParamsIdx[t]&255;return s-i>0?this._subParams.subarray(i,s):null}getSubParamsAll(){let t={};for(let i=0;i>8,r=this._subParamsIdx[i]&255;r-s>0&&(t[i]=this._subParams.slice(s,r))}return t}addDigit(t){let i;if(this._rejectDigits||!(i=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let s=this._digitIsSub?this._subParams:this.params,r=s[i-1];s[i-1]=~r?Math.min(r*10+t,qt):t}},Yt=[],Zu=class{constructor(){this._state=0,this._active=Yt,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Yt}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Yt,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Yt,!this._active.length)this._handlerFb(this._id,"START");else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,i){if(!this._active.length)this._handlerFb(this._id,"PUT",zi(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}start(){this.reset(),this._state=1}put(e,t,i){if(this._state!==3){if(this._state===1)for(;t0&&this._put(e,t,i)}}end(e,t=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,"END",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].end(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].end(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=Yt,this._id=-1,this._state=0}}},$e=class{constructor(e){this._handler=e,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=zi(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(i=>(this._data="",this._hitLimit=!1,i));return this._data="",this._hitLimit=!1,t}},jt=[],Ju=class{constructor(){this._handlers=Object.create(null),this._active=jt,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=jt}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let i=this._handlers[e];return i.push(t),{dispose:()=>{let s=i.indexOf(t);s!==-1&&i.splice(s,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=jt,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||jt,!this._active.length)this._handlerFb(this._ident,"HOOK",t);else for(let i=this._active.length-1;i>=0;i--)this._active[i].hook(t)}put(e,t,i){if(!this._active.length)this._handlerFb(this._ident,"PUT",zi(e,t,i));else for(let s=this._active.length-1;s>=0;s--)this._active[s].put(e,t,i)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,"UNHOOK",e);else{let i=!1,s=this._active.length-1,r=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,i=t,r=this._stack.fallThrough,this._stack.paused=!1),!r&&i===!1){for(;s>=0&&(i=this._active[s].unhook(e),i!==!0);s--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,i;s--}for(;s>=0;s--)if(i=this._active[s].unhook(!1),i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,i}this._active=jt,this._ident=0}},ei=new zo;ei.addParam(0);var _n=class{constructor(e){this._handler=e,this._data="",this._params=ei,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():ei,this._data="",this._hitLimit=!1}put(e,t,i){this._hitLimit||(this._data+=zi(e,t,i),this._data.length>1e7&&(this._data="",this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(i=>(this._params=ei,this._data="",this._hitLimit=!1,i));return this._params=ei,this._data="",this._hitLimit=!1,t}},Qu=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,i,s){this.table[t<<8|e]=i<<4|s}addMany(e,t,i,s){for(let r=0;rh),i=(a,h)=>t.slice(a,h),s=i(32,127),r=i(0,24);r.push(25),r.push.apply(r,i(28,32));let n=i(0,14),o;e.setDefault(1,0),e.addMany(s,0,2,0);for(o in n)e.addMany([24,26,153,154],o,3,0),e.addMany(i(128,144),o,3,0),e.addMany(i(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(r,0,3,0),e.addMany(r,1,3,1),e.add(127,1,0,1),e.addMany(r,8,0,8),e.addMany(r,3,3,3),e.add(127,3,0,3),e.addMany(r,4,3,4),e.add(127,4,0,4),e.addMany(r,6,3,6),e.addMany(r,5,3,5),e.add(127,5,0,5),e.addMany(r,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(s,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(i(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(s,7,0,7),e.addMany(r,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(i(64,127),3,7,0),e.addMany(i(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(i(48,60),4,8,4),e.addMany(i(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(i(32,64),6,0,6),e.add(127,6,0,6),e.addMany(i(64,127),6,0,0),e.addMany(i(32,48),3,9,5),e.addMany(i(32,48),5,9,5),e.addMany(i(48,64),5,0,6),e.addMany(i(64,127),5,7,0),e.addMany(i(32,48),4,9,5),e.addMany(i(32,48),1,9,2),e.addMany(i(32,48),2,9,2),e.addMany(i(48,127),2,10,0),e.addMany(i(48,80),1,10,0),e.addMany(i(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(i(96,127),1,10,0),e.add(80,1,11,9),e.addMany(r,9,0,9),e.add(127,9,0,9),e.addMany(i(28,32),9,0,9),e.addMany(i(32,48),9,9,12),e.addMany(i(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(r,11,0,11),e.addMany(i(32,128),11,0,11),e.addMany(i(28,32),11,0,11),e.addMany(r,10,0,10),e.add(127,10,0,10),e.addMany(i(28,32),10,0,10),e.addMany(i(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(i(32,48),10,9,12),e.addMany(r,12,0,12),e.add(127,12,0,12),e.addMany(i(28,32),12,0,12),e.addMany(i(32,48),12,9,12),e.addMany(i(48,64),12,0,11),e.addMany(i(64,127),12,12,13),e.addMany(i(64,127),10,12,13),e.addMany(i(64,127),9,12,13),e.addMany(r,13,13,13),e.addMany(s,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(Ue,0,2,0),e.add(Ue,8,5,8),e.add(Ue,6,0,6),e.add(Ue,11,0,11),e.add(Ue,13,13,13),e})(),t_=class extends G{constructor(e=e_){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new zo,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(t,i,s)=>{},this._executeHandlerFb=t=>{},this._csiHandlerFb=(t,i)=>{},this._escHandlerFb=t=>{},this._errorHandlerFb=t=>t,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(ne(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Zu),this._dcsParser=this._register(new Ju),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,t=[64,126]){let i=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(i=e.prefix.charCodeAt(0),i&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let r=0;rn||n>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(e.final.length!==1)throw new Error("final must be a single byte");let s=e.final.charCodeAt(0);if(t[0]>s||s>t[1])throw new Error(`final must be in range ${t[0]} .. ${t[1]}`);return i<<=8,i|=s,i}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join("")}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let i=this._identifier(e,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);let s=this._escHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let i=this._identifier(e);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);let s=this._csiHandlers[i];return s.push(t),{dispose:()=>{let r=s.indexOf(t);r!==-1&&s.splice(r,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,i,s,r){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=i,this._parseStack.transition=s,this._parseStack.chunkPos=r}parse(e,t,i){let s=0,r=0,n=0,o;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,n=this._parseStack.chunkPos+1;else{if(i===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let a=this._parseStack.handlers,h=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(i===!1&&h>-1){for(;h>=0&&(o=a[h](this._params),o!==!0);h--)if(o instanceof Promise)return this._parseStack.handlerPos=h,o}this._parseStack.handlers=[];break;case 4:if(i===!1&&h>-1){for(;h>=0&&(o=a[h](),o!==!0);h--)if(o instanceof Promise)return this._parseStack.handlerPos=h,o}this._parseStack.handlers=[];break;case 6:if(s=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(s=e[this._parseStack.chunkPos],o=this._oscParser.end(s!==24&&s!==26,i),o)return o;s===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break}this._parseStack.state=0,n=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}for(let a=n;a>4){case 2:for(let u=a+1;;++u){if(u>=t||(s=e[u])<32||s>126&&s=t||(s=e[u])<32||s>126&&s=t||(s=e[u])<32||s>126&&s=t||(s=e[u])<32||s>126&&s=0&&(o=h[l](this._params),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(3,h,l,r,a),o;l<0&&this._csiHandlerFb(this._collect<<8|s,this._params),this.precedingJoinState=0;break;case 8:do switch(s){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(s-48)}while(++a47&&s<60);a--;break;case 9:this._collect<<=8,this._collect|=s;break;case 10:let d=this._escHandlers[this._collect<<8|s],c=d?d.length-1:-1;for(;c>=0&&(o=d[c](),o!==!0);c--)if(o instanceof Promise)return this._preserveStack(4,d,c,r,a),o;c<0&&this._escHandlerFb(this._collect<<8|s),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|s,this._params);break;case 13:for(let u=a+1;;++u)if(u>=t||(s=e[u])===24||s===26||s===27||s>127&&s=t||(s=e[u])<32||s>127&&s>4:n>>8}return s}}function as(e,t){let i=e.toString(16),s=i.length<2?"0"+i:i;switch(t){case 4:return i[0];case 8:return s;case 12:return(s+s).slice(0,3);default:return s+s}}function r_(e,t=16){let[i,s,r]=e;return`rgb:${as(i,t)}/${as(s,t)}/${as(r,t)}`}var n_={"(":0,")":1,"*":2,"+":3,"-":1,".":2},_t=131072,pn=10;function gn(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var vn=5e3,mn=0,o_=class extends G{constructor(e,t,i,s,r,n,o,a,h=new t_){super(),this._bufferService=e,this._charsetService=t,this._coreService=i,this._logService=s,this._optionsService=r,this._oscLinkService=n,this._coreMouseService=o,this._unicodeService=a,this._parser=h,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new xc,this._utf8Decoder=new Ec,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=de.clone(),this._eraseAttrDataInternal=de.clone(),this._onRequestBell=this._register(new T),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new T),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new T),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new T),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new T),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new T),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new T),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new T),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new T),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new T),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new T),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new T),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new T),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new Xs(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(l=>this._activeBuffer=l.activeBuffer)),this._parser.setCsiHandlerFallback((l,d)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(l),params:d.toArray()})}),this._parser.setEscHandlerFallback(l=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(l)})}),this._parser.setExecuteHandlerFallback(l=>{this._logService.debug("Unknown EXECUTE code: ",{code:l})}),this._parser.setOscHandlerFallback((l,d,c)=>{this._logService.debug("Unknown OSC code: ",{identifier:l,action:d,data:c})}),this._parser.setDcsHandlerFallback((l,d,c)=>{d==="HOOK"&&(c=c.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(l),action:d,payload:c})}),this._parser.setPrintHandler((l,d,c)=>this.print(l,d,c)),this._parser.registerCsiHandler({final:"@"},l=>this.insertChars(l)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},l=>this.scrollLeft(l)),this._parser.registerCsiHandler({final:"A"},l=>this.cursorUp(l)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},l=>this.scrollRight(l)),this._parser.registerCsiHandler({final:"B"},l=>this.cursorDown(l)),this._parser.registerCsiHandler({final:"C"},l=>this.cursorForward(l)),this._parser.registerCsiHandler({final:"D"},l=>this.cursorBackward(l)),this._parser.registerCsiHandler({final:"E"},l=>this.cursorNextLine(l)),this._parser.registerCsiHandler({final:"F"},l=>this.cursorPrecedingLine(l)),this._parser.registerCsiHandler({final:"G"},l=>this.cursorCharAbsolute(l)),this._parser.registerCsiHandler({final:"H"},l=>this.cursorPosition(l)),this._parser.registerCsiHandler({final:"I"},l=>this.cursorForwardTab(l)),this._parser.registerCsiHandler({final:"J"},l=>this.eraseInDisplay(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},l=>this.eraseInDisplay(l,!0)),this._parser.registerCsiHandler({final:"K"},l=>this.eraseInLine(l,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},l=>this.eraseInLine(l,!0)),this._parser.registerCsiHandler({final:"L"},l=>this.insertLines(l)),this._parser.registerCsiHandler({final:"M"},l=>this.deleteLines(l)),this._parser.registerCsiHandler({final:"P"},l=>this.deleteChars(l)),this._parser.registerCsiHandler({final:"S"},l=>this.scrollUp(l)),this._parser.registerCsiHandler({final:"T"},l=>this.scrollDown(l)),this._parser.registerCsiHandler({final:"X"},l=>this.eraseChars(l)),this._parser.registerCsiHandler({final:"Z"},l=>this.cursorBackwardTab(l)),this._parser.registerCsiHandler({final:"`"},l=>this.charPosAbsolute(l)),this._parser.registerCsiHandler({final:"a"},l=>this.hPositionRelative(l)),this._parser.registerCsiHandler({final:"b"},l=>this.repeatPrecedingCharacter(l)),this._parser.registerCsiHandler({final:"c"},l=>this.sendDeviceAttributesPrimary(l)),this._parser.registerCsiHandler({prefix:">",final:"c"},l=>this.sendDeviceAttributesSecondary(l)),this._parser.registerCsiHandler({final:"d"},l=>this.linePosAbsolute(l)),this._parser.registerCsiHandler({final:"e"},l=>this.vPositionRelative(l)),this._parser.registerCsiHandler({final:"f"},l=>this.hVPosition(l)),this._parser.registerCsiHandler({final:"g"},l=>this.tabClear(l)),this._parser.registerCsiHandler({final:"h"},l=>this.setMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"h"},l=>this.setModePrivate(l)),this._parser.registerCsiHandler({final:"l"},l=>this.resetMode(l)),this._parser.registerCsiHandler({prefix:"?",final:"l"},l=>this.resetModePrivate(l)),this._parser.registerCsiHandler({final:"m"},l=>this.charAttributes(l)),this._parser.registerCsiHandler({final:"n"},l=>this.deviceStatus(l)),this._parser.registerCsiHandler({prefix:"?",final:"n"},l=>this.deviceStatusPrivate(l)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},l=>this.softReset(l)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},l=>this.setCursorStyle(l)),this._parser.registerCsiHandler({final:"r"},l=>this.setScrollRegion(l)),this._parser.registerCsiHandler({final:"s"},l=>this.saveCursor(l)),this._parser.registerCsiHandler({final:"t"},l=>this.windowOptions(l)),this._parser.registerCsiHandler({final:"u"},l=>this.restoreCursor(l)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},l=>this.insertColumns(l)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},l=>this.deleteColumns(l)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},l=>this.selectProtected(l)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},l=>this.requestMode(l,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},l=>this.requestMode(l,!1)),this._parser.setExecuteHandler(y.BEL,()=>this.bell()),this._parser.setExecuteHandler(y.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(y.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(y.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(y.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(y.BS,()=>this.backspace()),this._parser.setExecuteHandler(y.HT,()=>this.tab()),this._parser.setExecuteHandler(y.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(y.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(Mi.IND,()=>this.index()),this._parser.setExecuteHandler(Mi.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(Mi.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new $e(l=>(this.setTitle(l),this.setIconName(l),!0))),this._parser.registerOscHandler(1,new $e(l=>this.setIconName(l))),this._parser.registerOscHandler(2,new $e(l=>this.setTitle(l))),this._parser.registerOscHandler(4,new $e(l=>this.setOrReportIndexedColor(l))),this._parser.registerOscHandler(8,new $e(l=>this.setHyperlink(l))),this._parser.registerOscHandler(10,new $e(l=>this.setOrReportFgColor(l))),this._parser.registerOscHandler(11,new $e(l=>this.setOrReportBgColor(l))),this._parser.registerOscHandler(12,new $e(l=>this.setOrReportCursorColor(l))),this._parser.registerOscHandler(104,new $e(l=>this.restoreIndexedColor(l))),this._parser.registerOscHandler(110,new $e(l=>this.restoreFgColor(l))),this._parser.registerOscHandler(111,new $e(l=>this.restoreBgColor(l))),this._parser.registerOscHandler(112,new $e(l=>this.restoreCursorColor(l))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let l in me)this._parser.registerEscHandler({intermediates:"(",final:l},()=>this.selectCharset("("+l)),this._parser.registerEscHandler({intermediates:")",final:l},()=>this.selectCharset(")"+l)),this._parser.registerEscHandler({intermediates:"*",final:l},()=>this.selectCharset("*"+l)),this._parser.registerEscHandler({intermediates:"+",final:l},()=>this.selectCharset("+"+l)),this._parser.registerEscHandler({intermediates:"-",final:l},()=>this.selectCharset("-"+l)),this._parser.registerEscHandler({intermediates:".",final:l},()=>this.selectCharset("."+l)),this._parser.registerEscHandler({intermediates:"/",final:l},()=>this.selectCharset("/"+l));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(l=>(this._logService.error("Parsing error: ",l),l)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new _n((l,d)=>this.requestStatusString(l,d)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,i,s){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=i,this._parseStack.position=s}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((t,i)=>setTimeout(()=>i("#SLOW_TIMEOUT"),vn))]).catch(t=>{if(t!=="#SLOW_TIMEOUT")throw t;console.warn(`async parser handler taking longer than ${vn} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let i,s=this._activeBuffer.x,r=this._activeBuffer.y,n=0,o=this._parseStack.paused;if(o){if(i=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(i),i;s=this._parseStack.cursorStartX,r=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>_t&&(n=this._parseStack.position+_t)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e=="string"?` "${e}"`:` "${Array.prototype.map.call(e,l=>String.fromCharCode(l)).join("")}"`}`),this._logService.logLevel===0&&this._logService.trace("parsing data (codes)",typeof e=="string"?e.split("").map(l=>l.charCodeAt(0)):e),this._parseBuffer.length_t)for(let l=n;l0&&c.getWidth(this._activeBuffer.x-1)===2&&c.setCellFromCodepoint(this._activeBuffer.x-1,0,1,d);let u=this._parser.precedingJoinState;for(let v=t;va){if(h){let M=c,H=this._activeBuffer.x-C;for(this._activeBuffer.x=C,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),c=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),C>0&&c instanceof Jt&&c.copyCellsFrom(M,H,0,C,!1);H=0;)c.setCellFromCodepoint(this._activeBuffer.x++,0,0,d);continue}if(l&&(c.insertCells(this._activeBuffer.x,r-C,this._activeBuffer.getNullCell(d)),c.getWidth(a-1)===2&&c.setCellFromCodepoint(a-1,0,1,d)),c.setCellFromCodepoint(this._activeBuffer.x++,s,r,d),r>0)for(;--r;)c.setCellFromCodepoint(this._activeBuffer.x++,0,0,d)}this._parser.precedingJoinState=u,this._activeBuffer.x0&&c.getWidth(this._activeBuffer.x)===0&&!c.hasContent(this._activeBuffer.x)&&c.setCellFromCodepoint(this._activeBuffer.x,0,1,d),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final==="t"&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,i=>gn(i.params[0],this._optionsService.rawOptions.windowOptions)?t(i):!0):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new _n(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new $e(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,i,s=!1,r=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.replaceCells(t,i,this._activeBuffer.getNullCell(this._eraseAttrData()),r),s&&(n.isWrapped=!1)}_resetBufferLine(e,t=!1){let i=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);i&&(i.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),i.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let i;switch(e.params[0]){case 0:for(i=this._activeBuffer.y,this._dirtyRowTracker.markDirty(i),this._eraseInBufferLine(i++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);i=this._bufferService.cols&&(this._activeBuffer.lines.get(i+1).isWrapped=!1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(i=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,i-1);i--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+i)?.getTrimmedLength(););for(;i>=0;i--)this._bufferService.scroll(this._eraseAttrData())}else{for(i=this._bufferService.rows,this._dirtyRowTracker.markDirty(i-1);i--;)this._resetBufferLine(i,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let s=this._activeBuffer.lines.length-this._bufferService.rows;s>0&&(this._activeBuffer.lines.trimStart(s),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-s,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-s,0),this._onScroll.fire(0));break}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t);break}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y65535?2:1}let h=a;for(let l=1;l0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(y.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(y.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(y.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(y.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(y.ESC+"[>83;40003;0c")),!0}_is(e){return(this._optionsService.rawOptions.termName+"").indexOf(e)===0}setMode(e){for(let t=0;t(m[m.NOT_RECOGNIZED=0]="NOT_RECOGNIZED",m[m.SET=1]="SET",m[m.RESET=2]="RESET",m[m.PERMANENTLY_SET=3]="PERMANENTLY_SET",m[m.PERMANENTLY_RESET=4]="PERMANENTLY_RESET"))(i||={});let s=this._coreService.decPrivateModes,{activeProtocol:r,activeEncoding:n}=this._coreMouseService,o=this._coreService,{buffers:a,cols:h}=this._bufferService,{active:l,alt:d}=a,c=this._optionsService.rawOptions,u=(m,C)=>(o.triggerDataEvent(`${y.ESC}[${t?"":"?"}${m};${C}$y`),!0),v=m=>m?1:2,_=e.params[0];return t?_===2?u(_,4):_===4?u(_,v(o.modes.insertMode)):_===12?u(_,3):_===20?u(_,v(c.convertEol)):u(_,0):_===1?u(_,v(s.applicationCursorKeys)):_===3?u(_,c.windowOptions.setWinLines?h===80?2:h===132?1:0:0):_===6?u(_,v(s.origin)):_===7?u(_,v(s.wraparound)):_===8?u(_,3):_===9?u(_,v(r==="X10")):_===12?u(_,v(c.cursorBlink)):_===25?u(_,v(!o.isCursorHidden)):_===45?u(_,v(s.reverseWraparound)):_===66?u(_,v(s.applicationKeypad)):_===67?u(_,4):_===1e3?u(_,v(r==="VT200")):_===1002?u(_,v(r==="DRAG")):_===1003?u(_,v(r==="ANY")):_===1004?u(_,v(s.sendFocus)):_===1005?u(_,4):_===1006?u(_,v(n==="SGR")):_===1015?u(_,4):_===1016?u(_,v(n==="SGR_PIXELS")):_===1048?u(_,1):_===47||_===1047||_===1049?u(_,v(l===d)):_===2004?u(_,v(s.bracketedPasteMode)):_===2026?u(_,v(s.synchronizedOutput)):u(_,0)}_updateAttrColor(e,t,i,s,r){return t===2?(e|=50331648,e&=-16777216,e|=ai.fromColorRGB([i,s,r])):t===5&&(e&=-50331904,e|=33554432|i&255),e}_extractColor(e,t,i){let s=[0,0,-1,0,0,0],r=0,n=0;do{if(s[n+r]=e.params[t+n],e.hasSubParams(t+n)){let o=e.getSubParams(t+n),a=0;do s[1]===5&&(r=1),s[n+a+1+r]=o[a];while(++a=2||s[1]===2&&n+r>=5)break;s[1]&&(r=1)}while(++n+t5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=de.fg,e.bg=de.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,i,s=this._curAttrData;for(let r=0;r=30&&i<=37?(s.fg&=-50331904,s.fg|=16777216|i-30):i>=40&&i<=47?(s.bg&=-50331904,s.bg|=16777216|i-40):i>=90&&i<=97?(s.fg&=-50331904,s.fg|=16777216|i-90|8):i>=100&&i<=107?(s.bg&=-50331904,s.bg|=16777216|i-100|8):i===0?this._processSGR0(s):i===1?s.fg|=134217728:i===3?s.bg|=67108864:i===4?(s.fg|=268435456,this._processUnderline(e.hasSubParams(r)?e.getSubParams(r)[0]:1,s)):i===5?s.fg|=536870912:i===7?s.fg|=67108864:i===8?s.fg|=1073741824:i===9?s.fg|=2147483648:i===2?s.bg|=134217728:i===21?this._processUnderline(2,s):i===22?(s.fg&=-134217729,s.bg&=-134217729):i===23?s.bg&=-67108865:i===24?(s.fg&=-268435457,this._processUnderline(0,s)):i===25?s.fg&=-536870913:i===27?s.fg&=-67108865:i===28?s.fg&=-1073741825:i===29?s.fg&=2147483647:i===39?(s.fg&=-67108864,s.fg|=de.fg&16777215):i===49?(s.bg&=-67108864,s.bg|=de.bg&16777215):i===38||i===48||i===58?r+=this._extractColor(e,r,s):i===53?s.bg|=1073741824:i===55?s.bg&=-1073741825:i===59?(s.extended=s.extended.clone(),s.extended.underlineColor=-1,s.updateExtended()):i===100?(s.fg&=-67108864,s.fg|=de.fg&16777215,s.bg&=-67108864,s.bg|=de.bg&16777215):this._logService.debug("Unknown SGR attribute: %d.",i);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${y.ESC}[0n`);break;case 6:let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${y.ESC}[${t};${i}R`);break}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let t=this._activeBuffer.y+1,i=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${y.ESC}[?${t};${i}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=de.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle="block";break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle="underline";break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle="bar";break}let i=t%2===1;this._coreService.decPrivateModes.cursorBlink=i}return!0}setScrollRegion(e){let t=e.params[0]||1,i;return(e.length<2||(i=e.params[1])>this._bufferService.rows||i===0)&&(i=this._bufferService.rows),i>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=i-1,this._setCursor(0,0)),!0}windowOptions(e){if(!gn(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${y.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>pn&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>pn&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop());break}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],i=e.split(";");for(;i.length>1;){let s=i.shift(),r=i.shift();if(/^\d+$/.exec(s)){let n=parseInt(s);if(bn(n))if(r==="?")t.push({type:0,index:n});else{let o=fn(r);o&&t.push({type:1,index:n,color:o})}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(";");if(t===-1)return!0;let i=e.slice(0,t).trim(),s=e.slice(t+1);return s?this._createHyperlink(i,s):i.trim()?!1:this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let i=e.split(":"),s,r=i.findIndex(n=>n.startsWith("id="));return r!==-1&&(s=i[r].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:s,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let i=e.split(";");for(let s=0;s=this._specialColors.length);++s,++t)if(i[s]==="?")this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=fn(i[s]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],i=e.split(";");for(let s=0;s=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=de.clone(),this._eraseAttrDataInternal=de.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new Ve;e.content=1<<22|69,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t(this._coreService.triggerDataEvent(`${y.ESC}${o}${y.ESC}\\`),!0),s=this._bufferService.buffer,r=this._optionsService.rawOptions;return i(e==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:e==='"p'?'P1$r61;1"p':e==="r"?`P1$r${s.scrollTop+1};${s.scrollBottom+1}r`:e==="m"?"P1$r0m":e===" q"?`P1$r${{block:2,underline:4,bar:6}[r.cursorStyle]-(r.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},Xs=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){ethis.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(mn=e,e=t,t=mn),ethis.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};Xs=he([$(0,Le)],Xs);function bn(e){return 0<=e&&e<256}var a_=5e7,Sn=12,l_=50,h_=class extends G{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new T),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let i;for(;i=this._writeBuffer.shift();){this._action(i);let s=this._callbacks.shift();s&&s()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>a_)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let i=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let s=this._writeBuffer[this._bufferOffset],r=this._action(s,t);if(r){let o=a=>performance.now()-i>=Sn?setTimeout(()=>this._innerWrite(0,a)):this._innerWrite(i,a);r.catch(a=>(queueMicrotask(()=>{throw a}),Promise.resolve(!1))).then(o);return}let n=this._callbacks[this._bufferOffset];if(n&&n(),this._bufferOffset++,this._pendingData-=s.length,performance.now()-i>=Sn)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>l_&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},Gs=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let a=t.addMarker(t.ybase+t.y),h={data:e,id:this._nextId++,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(h,a)),this._dataByLinkId.set(h.id,h),h.id}let i=e,s=this._getEntryIdKey(i),r=this._entriesWithId.get(s);if(r)return this.addLineToLink(r.id,t.ybase+t.y),r.id;let n=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(i),data:i,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(o,n)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let i=this._dataByLinkId.get(e);if(i&&i.lines.every(s=>s.line!==t)){let s=this._bufferService.buffer.addMarker(t);i.lines.push(s),s.onDispose(()=>this._removeMarkerFromLink(i,s))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let i=e.lines.indexOf(t);i!==-1&&(e.lines.splice(i,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};Gs=he([$(0,Le)],Gs);var wn=!1,c_=class extends G{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new Nt),this._onBinary=this._register(new T),this.onBinary=this._onBinary.event,this._onData=this._register(new T),this.onData=this._onData.event,this._onLineFeed=this._register(new T),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new T),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new T),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new T),this._instantiationService=new Au,this.optionsService=this._register(new Vu(e)),this._instantiationService.setService(Pe,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Ks)),this._instantiationService.setService(Le,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(Vs)),this._instantiationService.setService(no,this._logService),this.coreService=this._register(this._instantiationService.createInstance(qs)),this._instantiationService.setService(Lt,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Ys)),this._instantiationService.setService(ro,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(xt)),this._instantiationService.setService(Rc,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Xu),this._instantiationService.setService(Mc,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(Gs),this._instantiationService.setService(oo,this._oscLinkService),this._inputHandler=this._register(new o_(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(ke.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(ke.forward(this._bufferService.onResize,this._onResize)),this._register(ke.forward(this.coreService.onData,this._onData)),this._register(ke.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new h_((t,i)=>this._inputHandler.parse(t,i))),this._register(ke.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new T),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!wn&&(this._logService.warn("writeSync is unreliable and will be removed soon."),wn=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,Ho),t=Math.max(t,Fo),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend==="conpty"&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(un.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:"H"},()=>(un(this._bufferService),!1))),this._windowsWrappingHeuristics.value=ne(()=>{for(let t of e)t.dispose()})}}},d_={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};function u_(e,t,i,s){let r={type:0,cancel:!1,key:void 0},n=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key==="UIKeyInputUpArrow"?t?r.key=y.ESC+"OA":r.key=y.ESC+"[A":e.key==="UIKeyInputLeftArrow"?t?r.key=y.ESC+"OD":r.key=y.ESC+"[D":e.key==="UIKeyInputRightArrow"?t?r.key=y.ESC+"OC":r.key=y.ESC+"[C":e.key==="UIKeyInputDownArrow"&&(t?r.key=y.ESC+"OB":r.key=y.ESC+"[B");break;case 8:r.key=e.ctrlKey?"\b":y.DEL,e.altKey&&(r.key=y.ESC+r.key);break;case 9:if(e.shiftKey){r.key=y.ESC+"[Z";break}r.key=y.HT,r.cancel=!0;break;case 13:r.key=e.altKey?y.ESC+y.CR:y.CR,r.cancel=!0;break;case 27:r.key=y.ESC,e.altKey&&(r.key=y.ESC+y.ESC),r.cancel=!0;break;case 37:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"D":t?r.key=y.ESC+"OD":r.key=y.ESC+"[D";break;case 39:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"C":t?r.key=y.ESC+"OC":r.key=y.ESC+"[C";break;case 38:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"A":t?r.key=y.ESC+"OA":r.key=y.ESC+"[A";break;case 40:if(e.metaKey)break;n?r.key=y.ESC+"[1;"+(n+1)+"B":t?r.key=y.ESC+"OB":r.key=y.ESC+"[B";break;case 45:!e.shiftKey&&!e.ctrlKey&&(r.key=y.ESC+"[2~");break;case 46:n?r.key=y.ESC+"[3;"+(n+1)+"~":r.key=y.ESC+"[3~";break;case 36:n?r.key=y.ESC+"[1;"+(n+1)+"H":t?r.key=y.ESC+"OH":r.key=y.ESC+"[H";break;case 35:n?r.key=y.ESC+"[1;"+(n+1)+"F":t?r.key=y.ESC+"OF":r.key=y.ESC+"[F";break;case 33:e.shiftKey?r.type=2:e.ctrlKey?r.key=y.ESC+"[5;"+(n+1)+"~":r.key=y.ESC+"[5~";break;case 34:e.shiftKey?r.type=3:e.ctrlKey?r.key=y.ESC+"[6;"+(n+1)+"~":r.key=y.ESC+"[6~";break;case 112:n?r.key=y.ESC+"[1;"+(n+1)+"P":r.key=y.ESC+"OP";break;case 113:n?r.key=y.ESC+"[1;"+(n+1)+"Q":r.key=y.ESC+"OQ";break;case 114:n?r.key=y.ESC+"[1;"+(n+1)+"R":r.key=y.ESC+"OR";break;case 115:n?r.key=y.ESC+"[1;"+(n+1)+"S":r.key=y.ESC+"OS";break;case 116:n?r.key=y.ESC+"[15;"+(n+1)+"~":r.key=y.ESC+"[15~";break;case 117:n?r.key=y.ESC+"[17;"+(n+1)+"~":r.key=y.ESC+"[17~";break;case 118:n?r.key=y.ESC+"[18;"+(n+1)+"~":r.key=y.ESC+"[18~";break;case 119:n?r.key=y.ESC+"[19;"+(n+1)+"~":r.key=y.ESC+"[19~";break;case 120:n?r.key=y.ESC+"[20;"+(n+1)+"~":r.key=y.ESC+"[20~";break;case 121:n?r.key=y.ESC+"[21;"+(n+1)+"~":r.key=y.ESC+"[21~";break;case 122:n?r.key=y.ESC+"[23;"+(n+1)+"~":r.key=y.ESC+"[23~";break;case 123:n?r.key=y.ESC+"[24;"+(n+1)+"~":r.key=y.ESC+"[24~";break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?r.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?r.key=y.NUL:e.keyCode>=51&&e.keyCode<=55?r.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?r.key=y.DEL:e.keyCode===219?r.key=y.ESC:e.keyCode===220?r.key=y.FS:e.keyCode===221&&(r.key=y.GS);else if((!i||s)&&e.altKey&&!e.metaKey){let o=d_[e.keyCode]?.[e.shiftKey?1:0];if(o)r.key=y.ESC+o;else if(e.keyCode>=65&&e.keyCode<=90){let a=e.ctrlKey?e.keyCode-64:e.keyCode+32,h=String.fromCharCode(a);e.shiftKey&&(h=h.toUpperCase()),r.key=y.ESC+h}else if(e.keyCode===32)r.key=y.ESC+(e.ctrlKey?y.NUL:" ");else if(e.key==="Dead"&&e.code.startsWith("Key")){let a=e.code.slice(3,4);e.shiftKey||(a=a.toLowerCase()),r.key=y.ESC+a,r.cancel=!0}}else i&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(r.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?r.key=e.key:e.key&&e.ctrlKey&&(e.key==="_"&&(r.key=y.US),e.key==="@"&&(r.key=y.NUL));break}return r}var ce=0,__=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new $i,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new $i,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((r,n)=>this._getKey(r)-this._getKey(n)),t=0,i=0,s=new Array(this._array.length+this._insertedValues.length);for(let r=0;r=this._array.length||this._getKey(e[t])<=this._getKey(this._array[i])?(s[r]=e[t],t++):s[r]=this._array[i++];this._array=s,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(ce=this._search(t),ce===-1)||this._getKey(this._array[ce])!==t)return!1;do if(this._array[ce]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(ce),!0;while(++cer-n),t=0,i=new Array(this._array.length-e.length),s=0;for(let r=0;r0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(ce=this._search(e),!(ce<0||ce>=this._array.length)&&this._getKey(this._array[ce])===e))do yield this._array[ce];while(++ce=this._array.length)&&this._getKey(this._array[ce])===e))do t(this._array[ce]);while(++ce=t;){let s=t+i>>1,r=this._getKey(this._array[s]);if(r>e)i=s-1;else if(r0&&this._getKey(this._array[s-1])===e;)s--;return s}}return t}},ls=0,yn=0,f_=class extends G{constructor(){super(),this._decorations=new __(e=>e?.marker.line),this._onDecorationRegistered=this._register(new T),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new T),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(ne(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new p_(e);if(t){let i=t.marker.onDispose(()=>t.dispose()),s=t.onDispose(()=>{s.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),i.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,i){let s=0,r=0;for(let n of this._decorations.getKeyIterator(t))s=n.options.x??0,r=s+(n.options.width??1),e>=s&&e{ls=r.options.x??0,yn=ls+(r.options.width??1),e>=ls&&e=this._debounceThresholdMS)this._lastRefreshMs=s,this._innerRefresh();else if(!this._additionalRefreshRequested){let r=s-this._lastRefreshMs,n=this._debounceThresholdMS-r;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},n)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},Cn=20,Hi=class extends G{constructor(e,t,i,s){super(),this._terminal=e,this._coreBrowserService=i,this._renderService=s,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="";let r=this._coreBrowserService.mainDocument;this._accessibilityContainer=r.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=r.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let n=0;nthis._handleBoundaryFocus(n,0),this._bottomBoundaryFocusListener=n=>this._handleBoundaryFocus(n,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=r.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new v_(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this._register(this._terminal.onResize(n=>this._handleResize(n.rows))),this._register(this._terminal.onRender(n=>this._refreshRows(n.start,n.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(n=>this._handleChar(n))),this._register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this._register(this._terminal.onA11yTab(n=>this._handleTab(n))),this._register(this._terminal.onKey(n=>this._handleKey(n.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(K(r,"selectionchange",()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(ne(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===Cn+1&&(this._liveRegion.textContent+=gs.get())))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let i=this._terminal.buffer,s=i.lines.length.toString();for(let r=e;r<=t;r++){let n=i.lines.get(i.ydisp+r),o=[],a=n?.translateToString(!0,void 0,void 0,o)||"",h=(i.ydisp+r+1).toString(),l=this._rowElements[r];l&&(a.length===0?(l.textContent=" ",this._rowColumns.set(l,[0,1])):(l.textContent=a,this._rowColumns.set(l,o)),l.setAttribute("aria-posinset",h),l.setAttribute("aria-setsize",s),this._alignRowWidth(l))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(e,t){let i=e.target,s=this._rowElements[t===0?1:this._rowElements.length-2],r=i.getAttribute("aria-posinset"),n=t===0?"1":`${this._terminal.buffer.lines.length}`;if(r===n||e.relatedTarget!==s)return;let o,a;if(t===0?(o=i,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(o=this._rowElements.shift(),a=i,this._rowContainer.removeChild(o)),o.removeEventListener("focus",this._topBoundaryFocusListener),a.removeEventListener("focus",this._bottomBoundaryFocusListener),t===0){let h=this._createAccessibilityTreeNode();this._rowElements.unshift(h),this._rowContainer.insertAdjacentElement("afterbegin",h)}else{let h=this._createAccessibilityTreeNode();this._rowElements.push(h),this._rowContainer.appendChild(h)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error("anchorNode and/or focusNode are null");return}let t={node:e.anchorNode,offset:e.anchorOffset},i={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(i.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===i.node&&t.offset>i.offset)&&([t,i]=[i,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let s=this._rowElements.slice(-1)[0];if(i.node.compareDocumentPosition(s)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(i={node:s,offset:s.textContent?.length??0}),!this._rowContainer.contains(i.node))return;let r=({node:a,offset:h})=>{let l=a instanceof Text?a.parentNode:a,d=parseInt(l?.getAttribute("aria-posinset"),10)-1;if(isNaN(d))return console.warn("row is invalid. Race condition?"),null;let c=this._rowColumns.get(l);if(!c)return console.warn("columns is null. Race condition?"),null;let u=h=this._terminal.cols&&(++d,u=0),{row:d,column:u}},n=r(t),o=r(i);if(!(!n||!o)){if(n.row>o.row||n.row===o.row&&n.column>=o.column)throw new Error("invalid range");this._terminal.select(n.column,n.row,(o.row-n.row)*this._terminal.cols-n.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let t=this._rowContainer.children.length;te;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e{Mt(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(K(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(K(this._element,"mousemove",this._handleMouseMove.bind(this))),this._register(K(this._element,"mousedown",this._handleMouseDown.bind(this))),this._register(K(this._element,"mouseup",this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let i=e.composedPath();for(let s=0;s{s?.forEach(r=>{r.link.dispose&&r.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let i=!1;for(let[s,r]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(s)&&(i=this._checkLinkProviderResult(s,e,i)):r.provideLinks(e.y,n=>{if(this._isMouseOut)return;let o=n?.map(a=>({link:a}));this._activeProviderReplies?.set(s,o),i=this._checkLinkProviderResult(s,e,i),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let i=new Set;for(let s=0;se?this._bufferService.cols:o.link.range.end.x;for(let l=a;l<=h;l++){if(i.has(l)){r.splice(n--,1);break}i.add(l)}}}}_checkLinkProviderResult(e,t,i){if(!this._activeProviderReplies)return i;let s=this._activeProviderReplies.get(e),r=!1;for(let n=0;nthis._linkAtPosition(o.link,t));n&&(i=!0,this._handleNewLink(n))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!i)for(let n=0;nthis._linkAtPosition(a.link,t));if(o){i=!0,this._handleNewLink(o);break}}return i}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&m_(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,Mt(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0?!0:e.link.decorations.underline,pointerCursor:e.link.decorations===void 0?!0:e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:i=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==i&&(this._currentLink.state.decorations.pointerCursor=i,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",i))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:i=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==i&&(this._currentLink.state.decorations.underline=i,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,i))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(i=>{if(!this._currentLink)return;let s=i.start===0?0:i.start+1+this._bufferService.buffer.ydisp,r=this._bufferService.buffer.ydisp+1+i.end;if(this._currentLink.link.range.start.y>=s&&this._currentLink.link.range.end.y<=r&&(this._clearCurrentLink(s,r),this._lastMouseEvent)){let n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._askForLink(n,!1)}})))}_linkHover(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(i,t.text)}_fireUnderlineEvent(e,t){let i=e.range,s=this._bufferService.buffer.ydisp,r=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-s-1,i.end.x,i.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(r)}_linkLeave(e,t,i){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(i,t.text)}_linkAtPosition(e,t){let i=e.range.start.y*this._bufferService.cols+e.range.start.x,s=e.range.end.y*this._bufferService.cols+e.range.end.x,r=t.y*this._bufferService.cols+t.x;return i<=r&&r<=s}_positionFromMouseEvent(e,t,i){let s=i.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,i,s,r){return{x1:e,y1:t,x2:i,y2:s,cols:this._bufferService.cols,fg:r}}};Zs=he([$(1,ur),$(2,lt),$(3,Le),$(4,lo)],Zs);function m_(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var b_=class extends c_{constructor(e={}){super(e),this._linkifier=this._register(new Nt),this.browser=Do,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new Nt),this._onCursorMove=this._register(new T),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new T),this.onKey=this._onKey.event,this._onRender=this._register(new T),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new T),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new T),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new T),this.onBell=this._onBell.event,this._onFocus=this._register(new T),this._onBlur=this._register(new T),this._onA11yCharEmitter=this._register(new T),this._onA11yTabEmitter=this._register(new T),this._onWillOpen=this._register(new T),this._setup(),this._decorationService=this._instantiationService.createInstance(f_),this._instantiationService.setService(li,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(lu),this._instantiationService.setService(lo,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(ms)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(t=>this.refresh(t?.start??0,t?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(t=>this._reportWindowsOptions(t))),this._register(this._inputHandler.onColor(t=>this._handleColorEvent(t))),this._register(ke.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(ke.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(ke.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(ke.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(t=>this._afterResize(t.cols,t.rows))),this._register(ne(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let i,s="";switch(t.index){case 256:i="foreground",s="10";break;case 257:i="background",s="11";break;case 258:i="cursor",s="12";break;default:i="ansi",s="4;"+t.index}switch(t.type){case 0:let r=re.toColorRGB(i==="ansi"?this._themeService.colors.ansi[t.index]:this._themeService.colors[i]);this.coreService.triggerDataEvent(`${y.ESC}]${s};${r_(r)}${Eo.ST}`);break;case 1:if(i==="ansi")this._themeService.modifyColors(n=>n.ansi[t.index]=_e.toColor(...t.color));else{let n=i;this._themeService.modifyColors(o=>o[n]=_e.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index);break}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Hi,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(y.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(y.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let i=Math.min(this.buffer.x,this.cols-1),s=this._renderService.dimensions.css.cell.height,r=t.getWidth(i),n=this._renderService.dimensions.css.cell.width*r,o=this.buffer.y*this._renderService.dimensions.css.cell.height,a=i*this._renderService.dimensions.css.cell.width;this.textarea.style.left=a+"px",this.textarea.style.top=o+"px",this.textarea.style.width=n+"px",this.textarea.style.height=s+"px",this.textarea.style.lineHeight=s+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this._register(K(this.element,"copy",t=>{this.hasSelection()&&Cc(t,this._selectionService)}));let e=t=>kc(t,this.textarea,this.coreService,this.optionsService);this._register(K(this.textarea,"paste",e)),this._register(K(this.element,"paste",e)),Mo?this._register(K(this.element,"mousedown",t=>{t.button===2&&Pr(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(K(this.element,"contextmenu",t=>{Pr(t,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),Sr&&this._register(K(this.element,"auxclick",t=>{t.button===1&&Qn(t,this.textarea,this.screenElement)}))}_bindKeys(){this._register(K(this.textarea,"keyup",e=>this._keyUp(e),!0)),this._register(K(this.textarea,"keydown",e=>this._keyDown(e),!0)),this._register(K(this.textarea,"keypress",e=>this._keyPress(e),!0)),this._register(K(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this._register(K(this.textarea,"compositionupdate",e=>this._compositionHelper.compositionupdate(e))),this._register(K(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this._register(K(this.textarea,"input",e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw new Error("Terminal requires a parent element.");if(e.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._register(K(this.screenElement,"mousemove",r=>this.updateCursorStyle(r))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let i=this.textarea=this._document.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",ps.get()),Po||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange("disableStdin",()=>i.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(ou,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(at,this._coreBrowserService),this._register(K(this.textarea,"focus",r=>this._handleTextAreaFocus(r))),this._register(K(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(Hs,this._document,this._helperContainer),this._instantiationService.setService(Wi,this._charSizeService),this._themeService=this._instantiationService.createInstance(Us),this._instantiationService.setService(Ft,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(Ni),this._instantiationService.setService(ao,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(zs,this.rows,this.screenElement)),this._instantiationService.setService(lt,this._renderService),this._register(this._renderService.onRenderedViewportChange(r=>this._onRender.fire(r))),this.onResize(r=>this._renderService.resize(r.cols,r.rows)),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(Ns,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(Fs),this._instantiationService.setService(ur,this._mouseService);let s=this._linkifier.value=this._register(this._instantiationService.createInstance(Zs,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance(As,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(r=>{super.scrollLines(r,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(Ws,this.element,this.screenElement,s)),this._instantiationService.setService(Pc,this._selectionService),this._register(this._selectionService.onRequestScrollLines(r=>this.scrollLines(r.amount,r.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(r=>this._renderService.handleSelectionChanged(r.start,r.end,r.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(r=>{this.textarea.value=r,this.textarea.focus(),this.textarea.select()})),this._register(ke.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(Is,this.screenElement)),this._register(K(this.element,"mousedown",r=>this._selectionService.handleMouseDown(r))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(Hi,this)),this._register(this.optionsService.onSpecificOptionChange("screenReaderMode",r=>this._handleScreenReaderModeOptionChange(r))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ii,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRuler",r=>{!this._overviewRulerRenderer&&r&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(Ii,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance($s,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function i(n){let o=e._mouseService.getMouseReportCoords(n,e.screenElement);if(!o)return!1;let a,h;switch(n.overrideType||n.type){case"mousemove":h=32,n.buttons===void 0?(a=3,n.button!==void 0&&(a=n.button<3?n.button:3)):a=n.buttons&1?0:n.buttons&4?1:n.buttons&2?2:3;break;case"mouseup":h=0,a=n.button<3?n.button:3;break;case"mousedown":h=1,a=n.button<3?n.button:3;break;case"wheel":if(e._customWheelEventHandler&&e._customWheelEventHandler(n)===!1)return!1;let l=n.deltaY;if(l===0||e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;h=l<0?0:1,a=4;break;default:return!1}return h===void 0||a===void 0||a>4?!1:e.coreMouseService.triggerMouseEvent({col:o.col,row:o.row,x:o.x,y:o.y,button:a,action:h,ctrl:n.ctrlKey,alt:n.altKey,shift:n.shiftKey})}let s={mouseup:null,wheel:null,mousedrag:null,mousemove:null},r={mouseup:n=>(i(n),n.buttons||(this._document.removeEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.removeEventListener("mousemove",s.mousedrag)),this.cancel(n)),wheel:n=>(i(n),this.cancel(n,!0)),mousedrag:n=>{n.buttons&&i(n)},mousemove:n=>{n.buttons||i(n)}};this._register(this.coreMouseService.onProtocolChange(n=>{n?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(n)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),n&8?s.mousemove||(t.addEventListener("mousemove",r.mousemove),s.mousemove=r.mousemove):(t.removeEventListener("mousemove",s.mousemove),s.mousemove=null),n&16?s.wheel||(t.addEventListener("wheel",r.wheel,{passive:!1}),s.wheel=r.wheel):(t.removeEventListener("wheel",s.wheel),s.wheel=null),n&2?s.mouseup||(s.mouseup=r.mouseup):(this._document.removeEventListener("mouseup",s.mouseup),s.mouseup=null),n&4?s.mousedrag||(s.mousedrag=r.mousedrag):(this._document.removeEventListener("mousemove",s.mousedrag),s.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(K(t,"mousedown",n=>{if(n.preventDefault(),this.focus(),!(!this.coreMouseService.areMouseEventsActive||this._selectionService.shouldForceSelection(n)))return i(n),s.mouseup&&this._document.addEventListener("mouseup",s.mouseup),s.mousedrag&&this._document.addEventListener("mousemove",s.mousedrag),this.cancel(n)})),this._register(K(t,"wheel",n=>{if(!s.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(n)===!1)return!1;if(!this.buffer.hasScrollback){if(n.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(n,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(n,!0);let o=y.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(n.deltaY<0?"A":"B");return this.coreService.triggerDataEvent(o,!0),this.cancel(n,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){Jn(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,i){this._selectionService.setSelection(e,t,i)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(!(!this._selectionService||!this._selectionService.hasSelection))return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key==="Dead"||e.key==="AltGraph")&&(this._unprocessedDeadKey=!0);let i=u_(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),i.type===3||i.type===2){let s=this.rows-1;return this.scrollLines(i.type===2?-s:s),this.cancel(e,!0)}if(i.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((i.key===y.ETX||i.key===y.CR)&&(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(i.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState("AltGraph");return t.type==="keypress"?i:i&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(S_(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType==="insertText"&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){if(e===this.cols&&t===this.rows){this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure();return}super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(!(this.buffer.ybase===0&&this.buffer.y===0)){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let i={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(i),t.dispose=()=>this._wrappedAddonDispose(i),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let i=0;i=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new Ve)}translateToString(e,t,i){return this._line.translateToString(e,t,i)}},kn=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new y_(t)}getNullCell(){return new Ve}},C_=class extends G{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new T),this.onBufferChange=this._onBufferChange.event,this._normal=new kn(this._core.buffers.normal,"normal"),this._alternate=new kn(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},k_=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,i=>t(i.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(i,s)=>t(i,s.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},x_=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},E_=["cols","rows"],je=0,B_=class extends G{constructor(e){super(),this._core=this._register(new b_(e)),this._addonManager=this._register(new w_),this._publicOptions={...this._core.options};let t=s=>this._core.options[s],i=(s,r)=>{this._checkReadonlyOptions(s),this._core.options[s]=r};for(let s in this._core.options){let r={get:t.bind(this,s),set:i.bind(this,s)};Object.defineProperty(this._publicOptions,s,r)}}_checkReadonlyOptions(e){if(E_.includes(e))throw new Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new k_(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x_(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this._register(new C_(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t="none";switch(this._core.coreMouseService.activeProtocol){case"X10":t="x10";break;case"VT200":t="vt200";break;case"DRAG":t="drag";break;case"ANY":t="any";break}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r +`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return ps.get()},set promptLabel(e){ps.set(e)},get tooMuchOutput(){return gs.get()},set tooMuchOutput(e){gs.set(e)}}}_verifyIntegers(...e){for(je of e)if(je===1/0||isNaN(je)||je%1!==0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...e){for(je of e)if(je&&(je===1/0||isNaN(je)||je%1!==0||je<0))throw new Error("This API only accepts positive integers")}};const D_={class:"flex min-h-0 flex-1 flex-col"},M_=fe({__name:"TerminalSession",props:{session:{},active:{type:Boolean}},emits:["titleChange","statusChange","exit"],setup(e,{emit:t}){const{t:i}=Ot(),s=e,r=t,n=q("#000000"),o=q({ctrl:"off",alt:"off"}),a=pc(),h=Q(()=>s.active&&a.value>100),l=Q(()=>({background:n.value})),d=er("terminalEl");let c=null,u=null,v=null,_=null,m=null;const C=new TextEncoder,M={ctrl:0,alt:0},H=D=>r("statusChange",D),I=()=>{const w=getComputedStyle(document.body).backgroundColor.match(/\d+(\.\d+)?/g);if(!w||w.length<3)return!0;const[S,z,Z]=w.map(Number);return .299*S+.587*z+.114*Z<128},f=()=>{const D=fc(Ie.value,I());return n.value=D.background??"#000000",D},L=()=>{c&&(c.options.theme=f(),c.options.fontFamily=Br(Ie.value),c.options.fontSize=Dr(Ie.value),u?.fit())},B=D=>{m?.send({message:{case:"input",value:{data:C.encode(D)}}})},U=D=>{const w=Date.now(),S=w-M[D]<300;M[D]=w,o.value=ic(o.value,D,S),c?.focus()},V=D=>{let w=null;D.kind==="special"?w=Qh(D.id,o.value):D.kind==="text"&&(w=xr(D.char,o.value)),w!==null&&B(w),o.value=Xi(o.value),c?.focus()},F=()=>{navigator.clipboard?.readText?.().then(D=>{D&&B(D)},()=>{}),o.value=Xi(o.value),c?.focus()};let R=0,N=0;const k=D=>{D.touches.length===1&&(R=D.touches[0].clientY,N=0)},b=D=>{if(D.touches.length!==1||!c||!d.value)return;const w=D.touches[0].clientY;N+=R-w,R=w;const S=d.value.clientHeight/c.rows||20,z=Math.trunc(N/S);z!==0&&(N-=z*S,c.buffer.active.type==="alternate"?B((z>0?"\x1B[B":"\x1B[A").repeat(Math.abs(z))):c.scrollLines(z)),D.preventDefault()},P=()=>{const D=Pn.value,w=D?Tn(D):"";if(!w||!d.value)return;H(i("connecting")),c=new B_({fontSize:Dr(Ie.value),fontFamily:Br(Ie.value),cursorBlink:!0,theme:f()}),u=new mc,c.loadAddon(u),c.open(d.value),u.fit(),c.focus(),d.value.addEventListener("touchstart",k,{passive:!0}),d.value.addEventListener("touchmove",b,{passive:!1}),v=new ResizeObserver(()=>{d.value&&d.value.clientWidth>0&&d.value.clientHeight>0&&u?.fit()}),v.observe(d.value),_=new MutationObserver(L),_.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});let S=!1,z=null;m=new An({baseUrl:w,secret:D?In(D):"",service:"daemon.StartedService",method:"StartTailscaleSSHSession",requestSchema:Xo,responseSchema:jo,onMessage:Z=>{const se=Z.message;switch(se.case){case"authBanner":c?.write(se.value.message.replaceAll(` `,`\r -`));break;case"ready":S=!0,z=null,F("");break;case"output":c?.write(se.value.data);break;case"exit":{const xe=se.value;let De=i("sessionExited",{code:xe.exitCode});xe.signal!==""&&(De+=` ${i("signalSuffix",{signal:xe.signal})}`),xe.errorMessage!==""&&(De+=`: ${xe.errorMessage}`),z=De,F(De),r("exit",xe.exitCode===0&&xe.errorMessage==="");break}case"error":z=se.value.message,F(se.value.message);break}},onEnd:(Z,se)=>{Z&&Z.code!==0?F(Z.message||i("streamEnded",{code:Z.code})):F(se&&!S?se:z??i("sessionClosed")),c&&(c.options.cursorBlink=!1)}}),m.send({message:{case:"start",value:{endpointTag:s.session.endpointTag,peerAddress:s.session.peerAddress,username:s.session.username,terminalType:s.session.terminalType,columns:c.cols,rows:c.rows,hostKeys:s.session.hostKeys}}}),c.onData(Z=>{const se=o.value;ic(se)?(B(Cr(Z,se)),o.value=Xi(se)):B(Z)}),c.onResize(({cols:Z,rows:se})=>{m?.send({message:{case:"resize",value:{columns:Z,rows:se}}})}),c.onTitleChange(Z=>{Z&&r("titleChange",Z)})};rt(Ie,R,{deep:!0}),rt(a,()=>{Qs(()=>{d.value&&d.value.clientWidth>0&&d.value.clientHeight>0&&u?.fit()})}),rt(()=>s.active,D=>{D&&(d.value&&d.value.clientWidth>0&&d.value.clientHeight>0&&u?.fit(),c?.focus())});const O=()=>{d.value?.removeEventListener("touchstart",k),d.value?.removeEventListener("touchmove",b),v?.disconnect(),v=null,_?.disconnect(),_=null,m?.close(),m=null,c?.dispose(),c=null,u=null};return Ht(P),ot(O),(D,w)=>Be((g(),x("div",R_,[p("div",{ref_key:"terminalEl",ref:d,class:"min-h-0 flex-1 overflow-hidden rounded p-1",style:Mn(l.value)},null,4),h.value?(g(),j(dc,{key:0,modifiers:o.value,onModifier:U,onKey:L,onPaste:K},null,8,["modifiers"])):W("",!0)],512)),[[jo,e.active]])}}),P_={class:"flex flex-col gap-3"},T_={class:"flex flex-col gap-1 text-sm"},A_=["value"],I_={class:"flex flex-col gap-1 text-sm"},N_=["value"],O_={class:"flex flex-col gap-1 text-sm"},$_={value:""},H_=["value"],F_={class:"flex flex-col gap-1 text-sm"},z_=["value"],W_=fe({__name:"TerminalSettingsDialog",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=Fi(e,"modelValue"),i=Br(!1),s=Br(!0);return(r,n)=>(g(),j($t,{modelValue:t.value,"onUpdate:modelValue":n[4]||(n[4]=o=>t.value=o),title:r.$t("terminalSettings")},{default:J(()=>[p("div",P_,[p("label",T_,[p("span",null,E(r.$t("terminalThemeLight")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[0]||(n[0]=o=>A(Ie).lightThemeName=o)},[(g(!0),x(ie,null,ve(A(i),o=>(g(),x("option",{key:o.name,value:o.name},E(o.name),9,A_))),128))],512),[[kt,A(Ie).lightThemeName]])]),p("label",I_,[p("span",null,E(r.$t("terminalThemeDark")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[1]||(n[1]=o=>A(Ie).darkThemeName=o)},[(g(!0),x(ie,null,ve(A(s),o=>(g(),x("option",{key:o.name,value:o.name},E(o.name),9,N_))),128))],512),[[kt,A(Ie).darkThemeName]])]),p("label",O_,[p("span",null,E(r.$t("fontFamily")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[2]||(n[2]=o=>A(Ie).fontFamily=o)},[p("option",$_,E(r.$t("defaultFont")),1),(g(!0),x(ie,null,ve(A(_c),o=>(g(),x("option",{key:o,value:o},E(o),9,H_))),128))],512),[[kt,A(Ie).fontFamily]])]),p("label",F_,[p("span",null,E(r.$t("fontSize")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[3]||(n[3]=o=>A(Ie).fontSize=o)},[(g(!0),x(ie,null,ve(A(uc),o=>(g(),x("option",{key:o,value:o},E(o),9,z_))),128))],512),[[kt,A(Ie).fontSize,void 0,{number:!0}]])])])]),_:1},8,["modelValue","title"]))}}),U_=()=>{const e=()=>{const t=window.visualViewport,i=t?t.height:window.innerHeight;document.documentElement.style.setProperty("--app-height",`${Math.round(i)}px`),t&&t.offsetTop!==0&&window.scrollTo(0,0)};Ht(()=>{e();const t=window.visualViewport;t?.addEventListener("resize",e),t?.addEventListener("scroll",e),window.addEventListener("resize",e)}),ot(()=>{const t=window.visualViewport;t?.removeEventListener("resize",e),t?.removeEventListener("scroll",e),window.removeEventListener("resize",e),document.documentElement.style.removeProperty("--app-height")})},V_={class:"bg-base-100 flex h-full flex-col"},K_={class:"flex items-center gap-2 p-2 sm:px-4"},q_=["aria-label"],Y_={class:"tabs-box tabs tabs-xs min-w-0 flex-1 overflow-x-auto"},j_=["onClick"],X_={class:"max-w-32 truncate"},G_=["aria-label","onClick"],Z_=["aria-label"],J_={class:"dropdown dropdown-end"},Q_=["aria-label"],ef={tabindex:"0",class:"dropdown-content menu bg-base-200 rounded-box z-30 w-56 p-1 shadow"},tf={key:0},sf=["onClick"],rf={key:0,class:"px-3 pb-1 text-xs opacity-70 sm:px-5"},nf=fe({__name:"TerminalPanel",props:{launch:{}},emits:["close"],setup(e,{emit:t}){const i=e,s=t;U_();const r=q([]),n=q(0),o=q(!1);let a=0;const h=Q(()=>r.value.find(f=>f.id===n.value)),l=Q(()=>h.value?.status??""),d=f=>f.title.trim()||`${f.options.username}@${f.options.peerName}`,c=f=>{const R=++a;r.value.push({id:R,options:f,title:"",status:""}),n.value=R},u=f=>{const R=r.value.filter(B=>B.id!==f);r.value=R,n.value===f&&(n.value=R[R.length-1]?.id??0)},v=(f,R)=>{R&&window.setTimeout(()=>u(f),1e3)},_=()=>{h.value&&c({...h.value.options})},m=q([]);let C=null;const M=Q(()=>m.value.find(f=>f.endpointTag===h.value?.options.endpointTag)),F=Q(()=>{const f=h.value?.options.peerAddress;return wr(M.value).filter(R=>Dt.value[R.stableID]?.remember&&qn(R)&&Kn(R)!==f)}),N=f=>{const R=wr(M.value).find(U=>U.stableID===f);if(!R||!h.value)return;const B=Dt.value[R.stableID];c(Yn(h.value.options.endpointTag,R,B?.username??fs,B?.terminalType??xi))};return Ht(()=>{c(i.launch);const f=Bt();f&&(C=ir(R=>f.client.subscribeTailscaleStatus({},{signal:R}),R=>m.value=R.endpoints))}),rt(()=>i.launch.seq,()=>c(i.launch)),rt(()=>r.value.length,f=>{f===0&&s("close")}),ot(()=>C?.close()),(f,R)=>(g(),x("div",V_,[p("div",K_,[p("button",{class:"btn btn-sm btn-circle btn-ghost","aria-label":f.$t("disconnect"),onClick:R[0]||(R[0]=B=>s("close"))},[Y(A(cs),{class:"h-5 w-5"})],8,q_),p("div",Y_,[(g(!0),x(ie,null,ve(r.value,B=>(g(),x("a",{key:B.id,role:"tab",class:Ne(["tab gap-1",B.id===n.value&&"tab-active"]),onClick:U=>n.value=B.id},[p("span",X_,E(d(B)),1),p("button",{class:"hover:text-error","aria-label":f.$t("disconnect"),onClick:Xt(U=>u(B.id),["stop"])},[Y(A(cs),{class:"h-3 w-3"})],8,G_)],10,j_))),128))]),p("button",{class:"btn btn-sm btn-circle btn-ghost","aria-label":f.$t("terminalSettings"),onClick:R[1]||(R[1]=B=>o.value=!0)},[Y(A(Zo),{class:"h-5 w-5"})],8,Z_),p("div",J_,[p("button",{tabindex:"0",class:"btn btn-sm btn-circle btn-ghost","aria-label":f.$t("newSession")},[Y(A(ds),{class:"h-5 w-5"})],8,Q_),p("ul",ef,[h.value?(g(),x("li",tf,[p("a",{onClick:_},[Y(A(An),{class:"h-4 w-4"}),ue(" "+E(h.value.options.peerName||f.$t("newSession")),1)])])):W("",!0),(g(!0),x(ie,null,ve(F.value,B=>(g(),x("li",{key:B.stableID},[p("a",{onClick:U=>N(B.stableID)},E(A(nt)(B)),9,sf)]))),128))])])]),l.value?(g(),x("div",rf,E(l.value),1)):W("",!0),(g(!0),x(ie,null,ve(r.value,B=>(g(),j(L_,{key:B.id,session:B.options,active:B.id===n.value,onTitleChange:U=>B.title=U,onStatusChange:U=>B.status=U,onExit:U=>v(B.id,U)},null,8,["session","active","onTitleChange","onStatusChange","onExit"]))),128)),Y(W_,{modelValue:o.value,"onUpdate:modelValue":R[2]||(R[2]=B=>o.value=B)},null,8,["modelValue"])]))}}),of={class:"flex min-h-11 items-center justify-between gap-3 px-4 py-2"},af={class:"text-base-content/55 flex-shrink-0"},Ke=fe({__name:"DataLine",props:{label:{},value:{},mono:{type:Boolean}},setup(e){return(t,i)=>(g(),x("div",of,[p("span",af,E(e.label),1),p("span",{class:Ne(["text-right break-all",e.mono&&"font-mono text-xs"])},E(e.value),3)]))}});function lf(){return typeof navigator>"u"||!("usb"in navigator)?{available:!1,reason:"unsupported"}:window.isSecureContext?{available:!0}:{available:!1,reason:"insecure"}}function hf(){return navigator.usb.requestDevice({filters:[]})}function It(e,t){const i=s=>s.toString(16).padStart(4,"0");return`${i(e)}:${i(t)}`}function cf(e){return e.usbVersionMajor>=3?5:e.usbVersionMajor>=2?3:2}function df(e,t){const i=e.configuration,s=(i?.interfaces??[]).map(r=>({interfaceClass:r.alternate?.interfaceClass??0,interfaceSubClass:r.alternate?.interfaceSubclass??0,interfaceProtocol:r.alternate?.interfaceProtocol??0}));return{deviceId:t,busNum:0,devNum:0,speed:cf(e),vendorId:e.vendorId,productId:e.productId,bcdDevice:e.deviceVersionMajor<<8|e.deviceVersionMinor<<4|e.deviceVersionSubminor,deviceClass:e.deviceClass,deviceSubClass:e.deviceSubclass,deviceProtocol:e.deviceProtocol,configurationValue:i?.configurationValue??0,numConfigurations:e.configurations.length,interfaces:s,serial:e.serialNumber??"",product:e.productName??""}}const uf=["standard","class","vendor"],_f=["device","interface","endpoint","other"];function ff(e){const t=e[0];return{requestType:uf[t>>5&3]??"vendor",recipient:_f[t&31]??"other",request:e[1],value:e[2]|e[3]<<8,index:e[4]|e[5]<<8}}const Pi=0,pf=-32,gf=-75,Js=-71,gt=new Uint8Array(0);function wi(e){switch(e){case"ok":return Pi;case"stall":return pf;case"babble":return gf;default:return Js}}function Cn(e){return e?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):gt}function kn(e){return new Uint8Array(e)}const vf=1,mf=9,bf=11,Sf=0;async function wf(e,t){if(t.requestType!=="standard")return null;if(t.recipient==="device"&&t.request===mf)return await yf(e,t.value&255),{status:Pi,actualLength:0,inData:gt};if(t.recipient==="interface"&&t.request===bf)return await e.selectAlternateInterface(t.index&255,t.value&255),{status:Pi,actualLength:0,inData:gt};if(t.recipient==="endpoint"&&t.request===vf&&(t.value&255)===Sf){const i=(t.index&128)!==0?"in":"out";return await e.clearHalt(i,t.index&15),{status:Pi,actualLength:0,inData:gt}}return null}async function yf(e,t){e.configuration?.configurationValue!==t&&(await Promise.all((e.configuration?.interfaces??[]).filter(i=>i.claimed).map(i=>e.releaseInterface(i.interfaceNumber).catch(()=>{}))),await e.selectConfiguration(t),await Promise.all((e.configuration?.interfaces??[]).map(i=>e.claimInterface(i.interfaceNumber).catch(()=>{}))))}async function Cf(e,t){try{const i=t.endpoint&15;if(i===0){const r=ff(t.setup);if((t.setup[0]&128)!==0){const a=await e.controlTransferIn(r,t.transferBufferLength),h=Cn(a.data);return{status:wi(a.status),actualLength:h.length,inData:h}}const n=await wf(e,r);if(n)return n;const o=await e.controlTransferOut(r,kn(t.outData));return{status:wi(o.status),actualLength:o.bytesWritten,inData:gt}}if(t.numberOfPackets>0)return console.warn("[usbip] isochronous transfers are not supported"),{status:Js,actualLength:0,inData:gt};if(t.directionIn){const r=await e.transferIn(i,t.transferBufferLength),n=Cn(r.data);return{status:wi(r.status),actualLength:n.length,inData:n}}const s=await e.transferOut(i,kn(t.outData));return{status:wi(s.status),actualLength:s.bytesWritten,inData:gt}}catch(i){return console.error("[usbip] URB transfer failed",i),{status:Js,actualLength:0,inData:gt}}}const kf=1e4,xf=e=>{const t=e instanceof Error?e.message:String(e);tr({content:t,type:"alert-error"})};function Ef(e){return e.productName||It(e.vendorId,e.productId)}function Bf(e){return{vendorId:e.vendorId,productId:e.productId,serialNumber:e.serialNumber,manufacturerName:e.manufacturerName,productName:e.productName}}function xn(e,t){return e.vendorId!==t.vendorId||e.productId!==t.productId?!1:e.serialNumber||t.serialNumber?e.serialNumber===t.serialNumber:!(e.manufacturerName&&t.manufacturerName&&e.manufacturerName!==t.manufacturerName||e.productName&&t.productName&&e.productName!==t.productName)}class Df{constructor(t,i,s,r,n,o){this.serverTag=s,this.onUpdate=r,this.onError=n,this.translate=o,this.stream=new In({baseUrl:t,secret:i,service:"daemon.StartedService",method:"ProvideUSBDevices",requestSchema:ea,responseSchema:Qo,onMessage:a=>this.onMessage(a),onEnd:(a,h)=>this.onEnd(a,h)}),this.addUsbEventListeners()}stream;nextDeviceId=1;usbDevices=new Map;reconnectIntents=[];detachedBusIdTimers=new Map;listeningToUsbEvents=!1;devices=new Map;closed=!1;endError=null;onUsbConnect=t=>{if(this.closed||this.exactDeviceIdForUsbDevice(t.device))return;const i=this.reconnectIntents.findIndex(s=>xn(s,t.device));i<0||(this.reconnectIntents.splice(i,1),this.attach(t.device).catch(s=>this.onError(s)))};onUsbDisconnect=t=>{const i=this.deviceIdForDisconnectedUsbDevice(t.device);i&&this.removeDevice(i,{rememberReconnect:!0,notifyServer:!0})};attachedDevices(){return new Set(this.usbDevices.values())}reconnectPending(){return this.reconnectIntents.length>0}recentlyDetachedBusIds(){return[...this.detachedBusIdTimers.keys()]}async attach(t){if(this.closed||this.exactDeviceIdForUsbDevice(t))return;const i=`dev-${this.nextDeviceId++}`,s={deviceId:i,label:Ef(t),vendorId:t.vendorId,productId:t.productId,state:"attaching"};this.devices.set(i,s),this.usbDevices.set(i,t),this.onUpdate();try{if(await t.open(),!t.configuration&&t.configurations[0]&&await t.selectConfiguration(t.configurations[0].configurationValue),await Mf(t,s.label,this.translate),this.closed||this.usbDevices.get(i)!==t){await yi(t);return}this.stream.send({message:{case:"attach",value:{serverTag:this.serverTag,descriptor:df(t,i)}}})}catch(r){const n=this.devices.get(i)===s;if(await yi(t),!n)return;throw this.devices.delete(i),this.usbDevices.delete(i),this.onUpdate(),r}}async detach(t){await this.removeDevice(t,{rememberReconnect:!1,notifyServer:!0})}close(){if(!this.closed){this.closed=!0,this.removeUsbEventListeners(),this.reconnectIntents=[];for(const t of this.usbDevices.keys())this.stream.send({message:{case:"detach",value:{deviceId:t}}});this.stream.close(),this.releaseAllUsbDevices(),this.devices.clear(),this.clearDetachedBusIds()}}releaseAllUsbDevices(){for(const t of this.usbDevices.values())yi(t);this.usbDevices.clear()}async removeDevice(t,i){const s=this.devices.get(t),r=this.usbDevices.get(t);!s&&!r||(i.rememberReconnect&&r&&this.reconnectIntents.push(Bf(r)),s?.busId&&this.suppressDetachedBusId(s.busId),i.notifyServer&&!this.closed&&this.stream.send({message:{case:"detach",value:{deviceId:t}}}),this.devices.delete(t),this.usbDevices.delete(t),this.onUpdate(),r&&await yi(r))}exactDeviceIdForUsbDevice(t){for(const[i,s]of this.usbDevices)if(s===t)return i;return null}deviceIdForDisconnectedUsbDevice(t){const i=this.exactDeviceIdForUsbDevice(t);if(i)return i;let s=null;for(const[r,n]of this.usbDevices)if(xn(n,t)){if(s)return null;s=r}return s}suppressDetachedBusId(t){this.clearDetachedBusId(t);const i=setTimeout(()=>{this.detachedBusIdTimers.delete(t),this.onUpdate()},kf);this.detachedBusIdTimers.set(t,i)}clearDetachedBusId(t){const i=this.detachedBusIdTimers.get(t);i&&(clearTimeout(i),this.detachedBusIdTimers.delete(t))}clearDetachedBusIds(){for(const t of this.detachedBusIdTimers.values())clearTimeout(t);this.detachedBusIdTimers.clear()}addUsbEventListeners(){typeof navigator>"u"||!("usb"in navigator)||(navigator.usb.addEventListener("connect",this.onUsbConnect),navigator.usb.addEventListener("disconnect",this.onUsbDisconnect),this.listeningToUsbEvents=!0)}removeUsbEventListeners(){this.listeningToUsbEvents&&(navigator.usb.removeEventListener("connect",this.onUsbConnect),navigator.usb.removeEventListener("disconnect",this.onUsbDisconnect),this.listeningToUsbEvents=!1)}onMessage(t){switch(t.message.case){case"ready":{const i=t.message.value,s=this.devices.get(i.deviceId);s&&(s.state="ready",s.busId=i.busId,this.clearDetachedBusId(i.busId),this.onUpdate());break}case"urbRequest":this.handleUrb(t.message.value);break;case"abort":break;case"error":{const i=t.message.value,s=this.devices.get(i.deviceId);s&&(s.state="error",s.error=i.message,this.onUpdate());break}}}async handleUrb(t){const i=this.usbDevices.get(t.deviceId);if(!i)return;const s=await Cf(i,t);this.closed||this.usbDevices.get(t.deviceId)===i&&this.stream.send({message:{case:"urbResponse",value:{deviceId:t.deviceId,seq:t.seq,status:s.status,actualLength:s.actualLength,inData:s.inData,isoPackets:[]}}})}onEnd(t,i){if(!this.closed){if(this.closed=!0,this.removeUsbEventListeners(),this.reconnectIntents=[],this.endError=i??(t&&t.code!==0?t.message||`gRPC error ${t.code}`:null),this.endError)for(const s of this.devices.values())s.state!=="error"&&(s.state="error",s.error=this.endError);this.releaseAllUsbDevices(),this.clearDetachedBusIds(),this.onUpdate()}}}async function Mf(e,t,i){const s=e.configuration?.interfaces??[];let r=!1,n=!1;if(await Promise.all(s.map(async o=>{try{await e.claimInterface(o.interfaceNumber)}catch(a){console.warn(`[usbip] could not claim interface ${o.interfaceNumber}`,a),r=!0,a instanceof Error&&a.name==="SecurityError"&&(n=!0)}})),!!r)throw new Error(n?i("usbipClaimBlockedClass",{label:t}):i("usbipClaimBlockedBusy",{label:t}))}async function yi(e){if(e.opened)try{await Promise.all((e.configuration?.interfaces??[]).map(t=>e.releaseInterface(t.interfaceNumber).catch(()=>{}))),await e.close()}catch(t){console.warn("[usbip] error releasing device",t)}}function Rf(e){const t=lf(),{t:i}=Ot(),s=Jo(null),r=q(0),n=()=>{r.value++},o=()=>{if(s.value&&!s.value.closed)return s.value;const M=Rn.value,F=M?Ln(M):"";return F?(s.value=new Df(F,M?Pn(M):"",e,n,xf,(N,f)=>i(N,f??{})),n(),s.value):null},a=Q(()=>t.available),h=Q(()=>t.available?void 0:t.reason),l=Q(()=>(r.value,s.value?[...s.value.devices.values()]:[])),d=Q(()=>(r.value,s.value?.endError??null)),c=Q(()=>(r.value,s.value?.reconnectPending()??!1)),u=Q(()=>(r.value,s.value?.recentlyDetachedBusIds()??[])),v=async()=>{if(!t.available)return[];let M;try{M=await navigator.usb.getDevices()}catch{return[]}const F=s.value?.attachedDevices()??new Set;return M.map(N=>({device:N,label:N.productName||It(N.vendorId,N.productId),vidPid:It(N.vendorId,N.productId),attached:F.has(N)}))},_=async M=>{t.available&&await o()?.attach(M)},m=async()=>{if(!t.available)return;let M;try{M=await hf()}catch{return}await o()?.attach(M)},C=M=>{s.value?.detach(M)};return ot(()=>{s.value?.close(),s.value=null}),{available:a,reason:h,devices:l,endError:d,reconnectPending:c,detachedBusIds:u,listPermitted:v,attachPermitted:_,connectNew:m,detach:C}}const Lf={1:"Audio",2:"CDC Control",3:"HID",5:"Physical",6:"Image",7:"Printer",8:"Mass Storage",9:"Hub",10:"CDC Data",11:"Smart Card",13:"Content Security",14:"Video",15:"Personal Healthcare",16:"Audio/Video",17:"Billboard",18:"USB-C Bridge",220:"Diagnostic",224:"Wireless",239:"Miscellaneous",254:"Application Specific",255:"Vendor Specific"},Ti=e=>`0x${e.toString(16).padStart(2,"0")}`;function Pf(e){return e===0?void 0:Lf[e]??Ti(e)}function En(e,t,i){const s=Pf(e)??Ti(e);return t>0||i>0?`${s} · ${Ti(t)} · ${Ti(i)}`:s}const Tf={1:"Low Speed",2:"Full Speed",3:"High Speed",4:"Wireless",5:"SuperSpeed",6:"SuperSpeed+"};function Af(e){return Tf[e]}function If(e){return`${e>>8&255}.${e>>4&15}${e&15}`}const Nf={class:"settings-section-label flex items-center justify-between gap-2 normal-case"},Of={class:"text-base-content/90 text-sm font-semibold tracking-normal"},$f={key:0,class:"dropdown dropdown-end"},Hf={tabindex:"0",class:"dropdown-content menu bg-base-100 rounded-box z-1 mt-1 max-h-80 w-64 flex-nowrap overflow-y-auto p-2 shadow-lg"},Ff={key:0,class:"p-2"},zf={key:0,class:"menu-title"},Wf=["disabled","onClick"],Uf={class:"truncate"},Vf={class:"font-mono text-xs opacity-60"},Kf={key:1,class:"menu-title pt-1"},qf={key:0,class:"alert alert-error alert-soft mb-2 rounded-xl py-2 text-sm"},Yf={class:"break-all"},jf={key:1,class:"bg-base-200/40 text-base-content/50 rounded-xl p-6 text-center text-sm"},Xf={key:2,class:"settings-grid"},Gf={class:"flex items-center gap-2.5"},Zf={class:"truncate text-sm font-medium"},Jf={key:0,class:"text-base-content/40 truncate text-xs"},Qf={key:0,class:"text-error pl-[1.125rem] text-xs break-all"},ep=["title","onClick"],tp={key:3,class:"text-base-content/50 px-1 pt-2 text-xs"},ip={key:0,class:"flex flex-col gap-4 text-sm"},sp={class:"text-base-content/45 mb-1 px-1 text-xs font-medium"},rp={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},np={class:"text-base-content/45 mb-1 px-1 text-xs font-medium"},op={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},ap={class:"text-base-content/45 mb-1 px-1 text-xs font-medium"},lp={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},hp=fe({__name:"UsbipServerPanel",props:{server:{},multiTag:{type:Boolean}},setup(e){const t=e,{t:i}=Ot(),s=Rf(t.server.serverTag),r=Q(()=>t.multiTag&&t.server.serverTag?i("usbipServerTagged",{tag:t.server.serverTag}):"USB/IP"),n={attaching:{tone:"medium",key:"usbipStateAttaching"},ready:{tone:"good",key:"usbipStateReady"},error:{tone:"bad",key:"usbipStateError"}},o=f=>{switch(f){case Yi.USB_DEVICE_STATE_IDLE:return{label:i("usbipStateIdle"),tone:"good"};case Yi.USB_DEVICE_STATE_ATTACHED:return{label:i("usbipStateAttached"),tone:"medium"};case Yi.USB_DEVICE_STATE_UNAVAILABLE:return{label:i("usbipStateUnavailable"),tone:"bad"}}},a=f=>{switch(f){case ui.USB_BACKEND_LINUX_SYSFS:return"linux-sysfs";case ui.USB_BACKEND_DYNAMIC:return"dynamic";case ui.USB_BACKEND_DARWIN_IOKIT:return"darwin-iokit";case ui.USB_BACKEND_WINDOWS_VBOXUSB:return"windows-vboxusb";default:return}},h=f=>{switch(f){case"good":return"bg-success";case"medium":return"bg-warning";case"bad":return"bg-error";default:return"bg-base-content/20"}},l=Q(()=>{const f=new Map;for(const L of s.devices.value)L.state==="ready"&&L.busId&&f.set(L.busId,L);const R=new Set,B=new Set(s.detachedBusIds.value),U=[];for(const L of t.server.devices){const K=L.descriptor,I=L.busId?f.get(L.busId):void 0;!I&&B.has(L.busId)||(I&&R.add(I.deviceId),U.push({key:L.stableId||L.busId,name:K?.product||(K?It(K.vendorId,K.productId):L.busId),vidPid:K?It(K.vendorId,K.productId):void 0,busId:L.busId,backend:a(L.backend),state:o(L.state),descriptor:K,onDetach:I?()=>s.detach(I.deviceId):void 0}))}for(const L of s.devices.value)R.has(L.deviceId)||U.push({key:`provided-${L.deviceId}`,name:L.label,vidPid:It(L.vendorId,L.productId),busId:L.state==="ready"?L.busId:void 0,state:{label:i(n[L.state].key),tone:n[L.state].tone},error:L.state==="error"?L.error:void 0,onDetach:()=>s.detach(L.deviceId)});return U}),d=q(null),c=()=>{d.value=null,s.listPermitted().then(f=>d.value=f,()=>d.value=[])},u=()=>{document.activeElement?.blur()},v=f=>{const R=f instanceof Error?f.message:String(f);tr({content:R,type:"alert-error"})},_=f=>{u(),s.attachPermitted(f.device).catch(v)},m=()=>{u(),s.connectNew().catch(v)},C=q(),M=q(!1),F=f=>{C.value=f,M.value=!0},N=Q(()=>C.value?.descriptor?Af(C.value.descriptor.speed):void 0);return(f,R)=>(g(),x(ie,null,[p("div",Nf,[p("span",Of,E(r.value),1),A(s).available.value?(g(),x("div",$f,[p("button",{tabindex:"0",class:"text-primary hover:bg-primary/10 flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium tracking-normal transition-colors",onClick:c},[Y(A(ds),{class:"h-4 w-4"}),ue(" "+E(f.$t("usbipConnectDevice")),1)]),p("ul",Hf,[d.value===null?(g(),x("li",Ff,[...R[1]||(R[1]=[p("span",{class:"loading loading-spinner loading-sm mx-auto"},null,-1)])])):(g(),x(ie,{key:1},[d.value.length>0?(g(),x("li",zf,E(f.$t("usbipAuthorizedDevices")),1)):W("",!0),(g(!0),x(ie,null,ve(d.value,(B,U)=>(g(),x("li",{key:`${B.vidPid}-${U}`},[p("button",{disabled:B.attached,class:"flex items-center justify-between gap-2",onClick:L=>_(B)},[p("span",Uf,E(B.label),1),p("span",Vf,E(B.vidPid),1)],8,Wf)]))),128)),d.value.length>0?(g(),x("li",Kf)):W("",!0),p("li",null,[p("button",{class:"gap-2",onClick:m},[Y(A(ds),{class:"h-4 w-4"}),ue(" "+E(f.$t("usbipOtherDevice")),1)])])],64))])])):W("",!0)]),A(s).endError.value?(g(),x("div",qf,[Y(A(ca),{class:"h-4 w-4 flex-shrink-0"}),p("span",Yf,E(A(s).endError.value),1)])):W("",!0),l.value.length===0?(g(),x("div",jf,E(A(s).available.value?f.$t("usbipPickDeviceHint"):f.$t("usbipNoDevicesShared")),1)):(g(),x("div",Xf,[(g(!0),x(ie,null,ve(l.value,B=>(g(),x("div",{key:B.key,class:"setting-item"},[(g(),j(Dn(B.descriptor?"button":"div"),{class:"flex min-w-0 flex-1 flex-col gap-0.5 text-left",onClick:U=>B.descriptor&&F(B)},{default:J(()=>[p("div",Gf,[p("span",{class:Ne(["inline-block h-2 w-2 shrink-0 rounded-full",h(B.state?.tone)])},null,2),p("span",Zf,E(B.name),1),B.state?(g(),x("span",Jf,E(B.state.label),1)):W("",!0)]),B.error?(g(),x("div",Qf,E(B.error),1)):W("",!0)]),_:2},1032,["onClick"])),B.onDetach?(g(),x("button",{key:0,class:"text-error/80 hover:bg-error/10 shrink-0 rounded-md p-1 transition-colors",title:f.$t("usbipDetach"),onClick:U=>B.onDetach()},[Y(A(cs),{class:"h-4 w-4"})],8,ep)):W("",!0),B.descriptor?(g(),j(A(Ci),{key:1,class:"text-base-content/25 h-4 w-4 shrink-0 cursor-pointer",onClick:U=>F(B)},null,8,["onClick"])):W("",!0)]))),128))])),A(s).available.value?W("",!0):(g(),x("div",tp,E(A(s).reason.value==="insecure"?f.$t("usbipInsecureContext"):f.$t("usbipUnsupportedBrowser")),1)),Y($t,{modelValue:M.value,"onUpdate:modelValue":R[0]||(R[0]=B=>M.value=B),title:C.value?.name??""},{default:J(()=>[C.value?.descriptor?(g(),x("div",ip,[p("div",null,[p("div",sp,E(f.$t("usbipIdentity")),1),p("div",rp,[C.value.descriptor.product?(g(),j(Ke,{key:0,label:f.$t("usbipProduct"),value:C.value.descriptor.product},null,8,["label","value"])):W("",!0),C.value.vidPid?(g(),j(Ke,{key:1,label:"VID:PID",value:C.value.vidPid,mono:""},null,8,["value"])):W("",!0),C.value.descriptor.serial?(g(),j(Ke,{key:2,label:f.$t("usbipSerialNumber"),value:C.value.descriptor.serial,mono:""},null,8,["label","value"])):W("",!0),C.value.descriptor.bcdDevice>0?(g(),j(Ke,{key:3,label:f.$t("usbipVersion"),value:A(If)(C.value.descriptor.bcdDevice),mono:""},null,8,["label","value"])):W("",!0)])]),p("div",null,[p("div",np,E(f.$t("usbipConnection")),1),p("div",op,[C.value.busId?(g(),j(Ke,{key:0,label:f.$t("usbipBusId"),value:C.value.busId,mono:""},null,8,["label","value"])):W("",!0),C.value.backend?(g(),j(Ke,{key:1,label:f.$t("usbipBackend"),value:C.value.backend,mono:""},null,8,["label","value"])):W("",!0),N.value?(g(),j(Ke,{key:2,label:f.$t("usbipSpeed"),value:N.value},null,8,["label","value"])):W("",!0),C.value.descriptor.busNum>0||C.value.descriptor.devNum>0?(g(),j(Ke,{key:3,label:f.$t("usbipBusDevice"),value:`${C.value.descriptor.busNum} · ${C.value.descriptor.devNum}`,mono:""},null,8,["label","value"])):W("",!0)])]),p("div",null,[p("div",ap,E(f.$t("usbipClassInterfaces")),1),p("div",lp,[Y(Ke,{label:f.$t("usbipDeviceClass"),value:C.value.descriptor.deviceClass===0?f.$t("usbipDefinedAtInterface"):A(En)(C.value.descriptor.deviceClass,C.value.descriptor.deviceSubClass,C.value.descriptor.deviceProtocol),mono:C.value.descriptor.deviceClass!==0},null,8,["label","value","mono"]),C.value.descriptor.numConfigurations>0?(g(),j(Ke,{key:0,label:f.$t("usbipConfigurations"),value:String(C.value.descriptor.numConfigurations),mono:""},null,8,["label","value"])):W("",!0),(g(!0),x(ie,null,ve(C.value.descriptor.interfaces,(B,U)=>(g(),j(Ke,{key:U,label:f.$t("usbipInterfaceN",{n:U+1}),value:A(En)(B.interfaceClass,B.interfaceSubClass,B.interfaceProtocol),mono:""},null,8,["label","value"]))),128))])])])):W("",!0)]),_:1},8,["modelValue","title"])],64))}}),cp={class:"mx-auto flex max-w-2xl flex-col p-2 sm:p-4"},dp={key:0,class:"text-base-content/50 p-12 text-center text-sm"},up=fe({__name:"UsbipPanel",setup(e){const t=q([]);let i=null;return Ht(()=>{const s=Bt();s&&(i=ir(r=>s.client.subscribeUSBIPServerStatus({},{signal:r}),r=>t.value=r.servers))}),ot(()=>i?.close()),(s,r)=>(g(),x("div",cp,[t.value.length===0?(g(),x("div",dp,E(s.$t("usbipNoServer")),1)):W("",!0),(g(!0),x(ie,null,ve(t.value,n=>(g(),j(hp,{key:n.serverTag,server:n,"multi-tag":t.value.length>1},null,8,["server","multi-tag"]))),128))]))}}),_p={class:"relative flex h-full min-h-0 flex-col"},fp={class:"flex items-center gap-2 p-2"},pp={key:0,class:"absolute inset-0 z-200"},gp=2,Sp=fe({__name:"ToolsPage",setup(e){const{t}=Ot(),i=q("tools"),s=Q(()=>na.value>=gp),r=Q(()=>[{value:"tools",label:t("tools"),icon:oa},...s.value?[{value:"usbip",label:t("usbip"),icon:aa}]:[],{value:"tailscale",label:t("tailscale"),icon:ua}]);rt(s,h=>{!h&&i.value==="usbip"&&(i.value="tools")});const{padding:n}=ta({offsetTop:0,offsetBottom:8}),o=q(),a=h=>{o.value={...h,seq:(o.value?.seq??0)+1}};return(h,l)=>(g(),x("div",_p,[Y(ia,null,{default:J(()=>[p("div",fp,[Y(ra,{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=d=>i.value=d),options:r.value},null,8,["modelValue","options"])])]),_:1}),p("div",{class:"min-h-0 flex-1 overflow-y-auto",style:Mn(A(n))},[(g(),j(sa,null,[i.value==="tools"?(g(),j(hl,{key:0})):i.value==="usbip"?(g(),j(up,{key:1})):(g(),j(Zh,{key:2,onSsh:a}))],1024))],4),o.value?(g(),x("div",pp,[Y(nf,{launch:o.value,onClose:l[1]||(l[1]=d=>o.value=void 0)},null,8,["launch"])])):W("",!0)]))}});export{Sp as default}; +`));break;case"ready":S=!0,z=null,H("");break;case"output":c?.write(se.value.data);break;case"exit":{const xe=se.value;let De=i("sessionExited",{code:xe.exitCode});xe.signal!==""&&(De+=` ${i("signalSuffix",{signal:xe.signal})}`),xe.errorMessage!==""&&(De+=`: ${xe.errorMessage}`),z=De,H(De),r("exit",xe.exitCode===0&&xe.errorMessage==="");break}case"error":z=se.value.message,H(se.value.message);break}},onEnd:(Z,se)=>{Z&&Z.code!==0?H(Z.message||i("streamEnded",{code:Z.code})):H(se&&!S?se:z??i("sessionClosed")),c&&(c.options.cursorBlink=!1)}}),m.send({message:{case:"start",value:{endpointTag:s.session.endpointTag,peerAddress:s.session.peerAddress,username:s.session.username,terminalType:s.session.terminalType,columns:c.cols,rows:c.rows,hostKeys:s.session.hostKeys}}}),c.onData(Z=>{const se=o.value;ec(se)?(B(xr(Z,se)),o.value=Xi(se)):B(Z)}),c.onResize(({cols:Z,rows:se})=>{m?.send({message:{case:"resize",value:{columns:Z,rows:se}}})}),c.onTitleChange(Z=>{Z&&r("titleChange",Z)})};Ze(Ie,L,{deep:!0}),Ze(a,()=>{Qs(()=>{d.value&&d.value.clientWidth>0&&d.value.clientHeight>0&&u?.fit()})}),Ze(()=>s.active,D=>{D&&(d.value&&d.value.clientWidth>0&&d.value.clientHeight>0&&u?.fit(),c?.focus())});const O=()=>{d.value?.removeEventListener("touchstart",k),d.value?.removeEventListener("touchmove",b),v?.disconnect(),v=null,_?.disconnect(),_=null,m?.close(),m=null,c?.dispose(),c=null,u=null};return Ht(P),ot(O),(D,w)=>Be((g(),x("div",D_,[p("div",{ref_key:"terminalEl",ref:d,class:"min-h-0 flex-1 overflow-hidden rounded p-1",style:Ln(l.value)},null,4),h.value?(g(),j(hc,{key:0,modifiers:o.value,onModifier:U,onKey:V,onPaste:F},null,8,["modifiers"])):W("",!0)],512)),[[Yo,e.active]])}}),R_={class:"flex flex-col gap-3"},L_={class:"flex flex-col gap-1 text-sm"},P_=["value"],T_={class:"flex flex-col gap-1 text-sm"},A_=["value"],I_={class:"flex flex-col gap-1 text-sm"},N_={value:""},O_=["value"],$_={class:"flex flex-col gap-1 text-sm"},H_=["value"],F_=fe({__name:"TerminalSettingsDialog",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=Fi(e,"modelValue"),i=Mr(!1),s=Mr(!0);return(r,n)=>(g(),j($t,{modelValue:t.value,"onUpdate:modelValue":n[4]||(n[4]=o=>t.value=o),title:r.$t("terminalSettings")},{default:J(()=>[p("div",R_,[p("label",L_,[p("span",null,E(r.$t("terminalThemeLight")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[0]||(n[0]=o=>A(Ie).lightThemeName=o)},[(g(!0),x(ie,null,ve(A(i),o=>(g(),x("option",{key:o.name,value:o.name},E(o.name),9,P_))),128))],512),[[kt,A(Ie).lightThemeName]])]),p("label",T_,[p("span",null,E(r.$t("terminalThemeDark")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[1]||(n[1]=o=>A(Ie).darkThemeName=o)},[(g(!0),x(ie,null,ve(A(s),o=>(g(),x("option",{key:o.name,value:o.name},E(o.name),9,A_))),128))],512),[[kt,A(Ie).darkThemeName]])]),p("label",I_,[p("span",null,E(r.$t("fontFamily")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[2]||(n[2]=o=>A(Ie).fontFamily=o)},[p("option",N_,E(r.$t("defaultFont")),1),(g(!0),x(ie,null,ve(A(dc),o=>(g(),x("option",{key:o,value:o},E(o),9,O_))),128))],512),[[kt,A(Ie).fontFamily]])]),p("label",$_,[p("span",null,E(r.$t("fontSize")),1),Be(p("select",{class:"select select-sm select-bordered","onUpdate:modelValue":n[3]||(n[3]=o=>A(Ie).fontSize=o)},[(g(!0),x(ie,null,ve(A(cc),o=>(g(),x("option",{key:o,value:o},E(o),9,H_))),128))],512),[[kt,A(Ie).fontSize,void 0,{number:!0}]])])])]),_:1},8,["modelValue","title"]))}}),z_=()=>{const e=()=>{const t=window.visualViewport,i=t?t.height:window.innerHeight;document.documentElement.style.setProperty("--app-height",`${Math.round(i)}px`),t&&t.offsetTop!==0&&window.scrollTo(0,0)};Ht(()=>{e();const t=window.visualViewport;t?.addEventListener("resize",e),t?.addEventListener("scroll",e),window.addEventListener("resize",e)}),ot(()=>{const t=window.visualViewport;t?.removeEventListener("resize",e),t?.removeEventListener("scroll",e),window.removeEventListener("resize",e),document.documentElement.style.removeProperty("--app-height")})},W_={class:"bg-base-100 flex h-full flex-col"},U_={class:"flex items-center gap-2 p-2 sm:px-4"},V_=["aria-label"],K_={class:"tabs-box tabs tabs-xs min-w-0 flex-1 overflow-x-auto"},q_=["onClick"],Y_={class:"max-w-32 truncate"},j_=["aria-label","onClick"],X_=["aria-label"],G_={class:"dropdown dropdown-end"},Z_=["aria-label"],J_={tabindex:"0",class:"dropdown-content menu bg-base-200 rounded-box z-30 w-56 p-1 shadow"},Q_={key:0},ef=["onClick"],tf={key:0,class:"px-3 pb-1 text-xs opacity-70 sm:px-5"},sf=fe({__name:"TerminalPanel",props:{launch:{}},emits:["close"],setup(e,{emit:t}){const i=e,s=t;z_();const r=q([]),n=q(0),o=q(!1);let a=0;const h=Q(()=>r.value.find(f=>f.id===n.value)),l=Q(()=>h.value?.status??""),d=f=>f.title.trim()||`${f.options.username}@${f.options.peerName}`,c=f=>{const L=++a;r.value.push({id:L,options:f,title:"",status:""}),n.value=L},u=f=>{const L=r.value.filter(B=>B.id!==f);r.value=L,n.value===f&&(n.value=L[L.length-1]?.id??0)},v=(f,L)=>{L&&window.setTimeout(()=>u(f),1e3)},_=()=>{h.value&&c({...h.value.options})},m=q([]);let C=null;const M=Q(()=>m.value.find(f=>f.endpointTag===h.value?.options.endpointTag)),H=Q(()=>{const f=h.value?.options.peerAddress;return Cr(M.value).filter(L=>Dt.value[L.stableID]?.remember&&jn(L)&&Yn(L)!==f)}),I=f=>{const L=Cr(M.value).find(U=>U.stableID===f);if(!L||!h.value)return;const B=Dt.value[L.stableID];c(Xn(h.value.options.endpointTag,L,B?.username??fs,B?.terminalType??xi))};return Ht(()=>{c(i.launch),Bt()&&(C=ir(f=>sr(rr.method.subscribeTailscaleStatus,{},f),f=>m.value=f.endpoints))}),Ze(()=>i.launch.seq,()=>c(i.launch)),Ze(()=>r.value.length,f=>{f===0&&s("close")}),ot(()=>C?.close()),(f,L)=>(g(),x("div",W_,[p("div",U_,[p("button",{class:"btn btn-sm btn-circle btn-ghost","aria-label":f.$t("disconnect"),onClick:L[0]||(L[0]=B=>s("close"))},[Y(A(cs),{class:"h-5 w-5"})],8,V_),p("div",K_,[(g(!0),x(ie,null,ve(r.value,B=>(g(),x("a",{key:B.id,role:"tab",class:Ne(["tab gap-1",B.id===n.value&&"tab-active"]),onClick:U=>n.value=B.id},[p("span",Y_,E(d(B)),1),p("button",{class:"hover:text-error","aria-label":f.$t("disconnect"),onClick:Xt(U=>u(B.id),["stop"])},[Y(A(cs),{class:"h-3 w-3"})],8,j_)],10,q_))),128))]),p("button",{class:"btn btn-sm btn-circle btn-ghost","aria-label":f.$t("terminalSettings"),onClick:L[1]||(L[1]=B=>o.value=!0)},[Y(A(Go),{class:"h-5 w-5"})],8,X_),p("div",G_,[p("button",{tabindex:"0",class:"btn btn-sm btn-circle btn-ghost","aria-label":f.$t("newSession")},[Y(A(ds),{class:"h-5 w-5"})],8,Z_),p("ul",J_,[h.value?(g(),x("li",Q_,[p("a",{onClick:_},[Y(A(On),{class:"h-4 w-4"}),ue(" "+E(h.value.options.peerName||f.$t("newSession")),1)])])):W("",!0),(g(!0),x(ie,null,ve(H.value,B=>(g(),x("li",{key:B.stableID},[p("a",{onClick:U=>I(B.stableID)},E(A(nt)(B)),9,ef)]))),128))])])]),l.value?(g(),x("div",tf,E(l.value),1)):W("",!0),(g(!0),x(ie,null,ve(r.value,B=>(g(),j(M_,{key:B.id,session:B.options,active:B.id===n.value,onTitleChange:U=>B.title=U,onStatusChange:U=>B.status=U,onExit:U=>v(B.id,U)},null,8,["session","active","onTitleChange","onStatusChange","onExit"]))),128)),Y(F_,{modelValue:o.value,"onUpdate:modelValue":L[2]||(L[2]=B=>o.value=B)},null,8,["modelValue"])]))}}),rf={class:"flex min-h-11 items-center justify-between gap-3 px-4 py-2"},nf={class:"text-base-content/55 flex-shrink-0"},Ke=fe({__name:"DataLine",props:{label:{},value:{},mono:{type:Boolean}},setup(e){return(t,i)=>(g(),x("div",rf,[p("span",nf,E(e.label),1),p("span",{class:Ne(["text-right break-all",e.mono&&"font-mono text-xs"])},E(e.value),3)]))}});function of(){return typeof navigator>"u"||!("usb"in navigator)?{available:!1,reason:"unsupported"}:window.isSecureContext?{available:!0}:{available:!1,reason:"insecure"}}function af(){return navigator.usb.requestDevice({filters:[]})}function It(e,t){const i=s=>s.toString(16).padStart(4,"0");return`${i(e)}:${i(t)}`}function lf(e){return e.usbVersionMajor>=3?5:e.usbVersionMajor>=2?3:2}function hf(e,t){const i=e.configuration,s=(i?.interfaces??[]).map(r=>({interfaceClass:r.alternate?.interfaceClass??0,interfaceSubClass:r.alternate?.interfaceSubclass??0,interfaceProtocol:r.alternate?.interfaceProtocol??0}));return{deviceId:t,busNum:0,devNum:0,speed:lf(e),vendorId:e.vendorId,productId:e.productId,bcdDevice:e.deviceVersionMajor<<8|e.deviceVersionMinor<<4|e.deviceVersionSubminor,deviceClass:e.deviceClass,deviceSubClass:e.deviceSubclass,deviceProtocol:e.deviceProtocol,configurationValue:i?.configurationValue??0,numConfigurations:e.configurations.length,interfaces:s,serial:e.serialNumber??"",product:e.productName??""}}const cf=["standard","class","vendor"],df=["device","interface","endpoint","other"];function uf(e){const t=e[0];return{requestType:cf[t>>5&3]??"vendor",recipient:df[t&31]??"other",request:e[1],value:e[2]|e[3]<<8,index:e[4]|e[5]<<8}}const Pi=0,_f=-32,ff=-75,Js=-71,gt=new Uint8Array(0);function wi(e){switch(e){case"ok":return Pi;case"stall":return _f;case"babble":return ff;default:return Js}}function xn(e){return e?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):gt}function En(e){return new Uint8Array(e)}const pf=1,gf=9,vf=11,mf=0;async function bf(e,t){if(t.requestType!=="standard")return null;if(t.recipient==="device"&&t.request===gf)return await Sf(e,t.value&255),{status:Pi,actualLength:0,inData:gt};if(t.recipient==="interface"&&t.request===vf)return await e.selectAlternateInterface(t.index&255,t.value&255),{status:Pi,actualLength:0,inData:gt};if(t.recipient==="endpoint"&&t.request===pf&&(t.value&255)===mf){const i=(t.index&128)!==0?"in":"out";return await e.clearHalt(i,t.index&15),{status:Pi,actualLength:0,inData:gt}}return null}async function Sf(e,t){e.configuration?.configurationValue!==t&&(await Promise.all((e.configuration?.interfaces??[]).filter(i=>i.claimed).map(i=>e.releaseInterface(i.interfaceNumber).catch(()=>{}))),await e.selectConfiguration(t),await Promise.all((e.configuration?.interfaces??[]).map(i=>e.claimInterface(i.interfaceNumber).catch(()=>{}))))}async function wf(e,t){try{const i=t.endpoint&15;if(i===0){const r=uf(t.setup);if((t.setup[0]&128)!==0){const a=await e.controlTransferIn(r,t.transferBufferLength),h=xn(a.data);return{status:wi(a.status),actualLength:h.length,inData:h}}const n=await bf(e,r);if(n)return n;const o=await e.controlTransferOut(r,En(t.outData));return{status:wi(o.status),actualLength:o.bytesWritten,inData:gt}}if(t.numberOfPackets>0)return console.warn("[usbip] isochronous transfers are not supported"),{status:Js,actualLength:0,inData:gt};if(t.directionIn){const r=await e.transferIn(i,t.transferBufferLength),n=xn(r.data);return{status:wi(r.status),actualLength:n.length,inData:n}}const s=await e.transferOut(i,En(t.outData));return{status:wi(s.status),actualLength:s.bytesWritten,inData:gt}}catch(i){return console.error("[usbip] URB transfer failed",i),{status:Js,actualLength:0,inData:gt}}}const yf=1e4,Cf=e=>{const t=e instanceof Error?e.message:String(e);tr({content:t,type:"alert-error"})};function kf(e){return e.productName||It(e.vendorId,e.productId)}function xf(e){return{vendorId:e.vendorId,productId:e.productId,serialNumber:e.serialNumber,manufacturerName:e.manufacturerName,productName:e.productName}}function Bn(e,t){return e.vendorId!==t.vendorId||e.productId!==t.productId?!1:e.serialNumber||t.serialNumber?e.serialNumber===t.serialNumber:!(e.manufacturerName&&t.manufacturerName&&e.manufacturerName!==t.manufacturerName||e.productName&&t.productName&&e.productName!==t.productName)}class Ef{constructor(t,i,s,r,n,o){this.serverTag=s,this.onUpdate=r,this.onError=n,this.translate=o,this.stream=new An({baseUrl:t,secret:i,service:"daemon.StartedService",method:"ProvideUSBDevices",requestSchema:Qo,responseSchema:Jo,onMessage:a=>this.onMessage(a),onEnd:(a,h)=>this.onEnd(a,h)}),this.addUsbEventListeners()}stream;nextDeviceId=1;usbDevices=new Map;reconnectIntents=[];detachedBusIdTimers=new Map;listeningToUsbEvents=!1;devices=new Map;closed=!1;endError=null;onUsbConnect=t=>{if(this.closed||this.exactDeviceIdForUsbDevice(t.device))return;const i=this.reconnectIntents.findIndex(s=>Bn(s,t.device));i<0||(this.reconnectIntents.splice(i,1),this.attach(t.device).catch(s=>this.onError(s)))};onUsbDisconnect=t=>{const i=this.deviceIdForDisconnectedUsbDevice(t.device);i&&this.removeDevice(i,{rememberReconnect:!0,notifyServer:!0})};attachedDevices(){return new Set(this.usbDevices.values())}reconnectPending(){return this.reconnectIntents.length>0}recentlyDetachedBusIds(){return[...this.detachedBusIdTimers.keys()]}async attach(t){if(this.closed||this.exactDeviceIdForUsbDevice(t))return;const i=`dev-${this.nextDeviceId++}`,s={deviceId:i,label:kf(t),vendorId:t.vendorId,productId:t.productId,state:"attaching"};this.devices.set(i,s),this.usbDevices.set(i,t),this.onUpdate();try{if(await t.open(),!t.configuration&&t.configurations[0]&&await t.selectConfiguration(t.configurations[0].configurationValue),await Bf(t,s.label,this.translate),this.closed||this.usbDevices.get(i)!==t){await yi(t);return}this.stream.send({message:{case:"attach",value:{serverTag:this.serverTag,descriptor:hf(t,i)}}})}catch(r){const n=this.devices.get(i)===s;if(await yi(t),!n)return;throw this.devices.delete(i),this.usbDevices.delete(i),this.onUpdate(),r}}async detach(t){await this.removeDevice(t,{rememberReconnect:!1,notifyServer:!0})}close(){if(!this.closed){this.closed=!0,this.removeUsbEventListeners(),this.reconnectIntents=[];for(const t of this.usbDevices.keys())this.stream.send({message:{case:"detach",value:{deviceId:t}}});this.stream.close(),this.releaseAllUsbDevices(),this.devices.clear(),this.clearDetachedBusIds()}}releaseAllUsbDevices(){for(const t of this.usbDevices.values())yi(t);this.usbDevices.clear()}async removeDevice(t,i){const s=this.devices.get(t),r=this.usbDevices.get(t);!s&&!r||(i.rememberReconnect&&r&&this.reconnectIntents.push(xf(r)),s?.busId&&this.suppressDetachedBusId(s.busId),i.notifyServer&&!this.closed&&this.stream.send({message:{case:"detach",value:{deviceId:t}}}),this.devices.delete(t),this.usbDevices.delete(t),this.onUpdate(),r&&await yi(r))}exactDeviceIdForUsbDevice(t){for(const[i,s]of this.usbDevices)if(s===t)return i;return null}deviceIdForDisconnectedUsbDevice(t){const i=this.exactDeviceIdForUsbDevice(t);if(i)return i;let s=null;for(const[r,n]of this.usbDevices)if(Bn(n,t)){if(s)return null;s=r}return s}suppressDetachedBusId(t){this.clearDetachedBusId(t);const i=setTimeout(()=>{this.detachedBusIdTimers.delete(t),this.onUpdate()},yf);this.detachedBusIdTimers.set(t,i)}clearDetachedBusId(t){const i=this.detachedBusIdTimers.get(t);i&&(clearTimeout(i),this.detachedBusIdTimers.delete(t))}clearDetachedBusIds(){for(const t of this.detachedBusIdTimers.values())clearTimeout(t);this.detachedBusIdTimers.clear()}addUsbEventListeners(){typeof navigator>"u"||!("usb"in navigator)||(navigator.usb.addEventListener("connect",this.onUsbConnect),navigator.usb.addEventListener("disconnect",this.onUsbDisconnect),this.listeningToUsbEvents=!0)}removeUsbEventListeners(){this.listeningToUsbEvents&&(navigator.usb.removeEventListener("connect",this.onUsbConnect),navigator.usb.removeEventListener("disconnect",this.onUsbDisconnect),this.listeningToUsbEvents=!1)}onMessage(t){switch(t.message.case){case"ready":{const i=t.message.value,s=this.devices.get(i.deviceId);s&&(s.state="ready",s.busId=i.busId,this.clearDetachedBusId(i.busId),this.onUpdate());break}case"urbRequest":this.handleUrb(t.message.value);break;case"abort":break;case"error":{const i=t.message.value,s=this.devices.get(i.deviceId);s&&(s.state="error",s.error=i.message,this.onUpdate());break}}}async handleUrb(t){const i=this.usbDevices.get(t.deviceId);if(!i)return;const s=await wf(i,t);this.closed||this.usbDevices.get(t.deviceId)===i&&this.stream.send({message:{case:"urbResponse",value:{deviceId:t.deviceId,seq:t.seq,status:s.status,actualLength:s.actualLength,inData:s.inData,isoPackets:[]}}})}onEnd(t,i){if(!this.closed){if(this.closed=!0,this.removeUsbEventListeners(),this.reconnectIntents=[],this.endError=i??(t&&t.code!==0?t.message||`gRPC error ${t.code}`:null),this.endError)for(const s of this.devices.values())s.state!=="error"&&(s.state="error",s.error=this.endError);this.releaseAllUsbDevices(),this.clearDetachedBusIds(),this.onUpdate()}}}async function Bf(e,t,i){const s=e.configuration?.interfaces??[];let r=!1,n=!1;if(await Promise.all(s.map(async o=>{try{await e.claimInterface(o.interfaceNumber)}catch(a){console.warn(`[usbip] could not claim interface ${o.interfaceNumber}`,a),r=!0,a instanceof Error&&a.name==="SecurityError"&&(n=!0)}})),!!r)throw new Error(n?i("usbipClaimBlockedClass",{label:t}):i("usbipClaimBlockedBusy",{label:t}))}async function yi(e){if(e.opened)try{await Promise.all((e.configuration?.interfaces??[]).map(t=>e.releaseInterface(t.interfaceNumber).catch(()=>{}))),await e.close()}catch(t){console.warn("[usbip] error releasing device",t)}}function Df(e){const t=of(),{t:i}=Ot(),s=Zo(null),r=q(0),n=()=>{r.value++},o=()=>{if(s.value&&!s.value.closed)return s.value;const M=Pn.value,H=M?Tn(M):"";return H?(s.value=new Ef(H,M?In(M):"",e,n,Cf,(I,f)=>i(I,f??{})),n(),s.value):null},a=Q(()=>t.available),h=Q(()=>t.available?void 0:t.reason),l=Q(()=>(r.value,s.value?[...s.value.devices.values()]:[])),d=Q(()=>(r.value,s.value?.endError??null)),c=Q(()=>(r.value,s.value?.reconnectPending()??!1)),u=Q(()=>(r.value,s.value?.recentlyDetachedBusIds()??[])),v=async()=>{if(!t.available)return[];let M;try{M=await navigator.usb.getDevices()}catch{return[]}const H=s.value?.attachedDevices()??new Set;return M.map(I=>({device:I,label:I.productName||It(I.vendorId,I.productId),vidPid:It(I.vendorId,I.productId),attached:H.has(I)}))},_=async M=>{t.available&&await o()?.attach(M)},m=async()=>{if(!t.available)return;let M;try{M=await af()}catch{return}await o()?.attach(M)},C=M=>{s.value?.detach(M)};return ot(()=>{s.value?.close(),s.value=null}),{available:a,reason:h,devices:l,endError:d,reconnectPending:c,detachedBusIds:u,listPermitted:v,attachPermitted:_,connectNew:m,detach:C}}const Mf={1:"Audio",2:"CDC Control",3:"HID",5:"Physical",6:"Image",7:"Printer",8:"Mass Storage",9:"Hub",10:"CDC Data",11:"Smart Card",13:"Content Security",14:"Video",15:"Personal Healthcare",16:"Audio/Video",17:"Billboard",18:"USB-C Bridge",220:"Diagnostic",224:"Wireless",239:"Miscellaneous",254:"Application Specific",255:"Vendor Specific"},Ti=e=>`0x${e.toString(16).padStart(2,"0")}`;function Rf(e){return e===0?void 0:Mf[e]??Ti(e)}function Dn(e,t,i){const s=Rf(e)??Ti(e);return t>0||i>0?`${s} · ${Ti(t)} · ${Ti(i)}`:s}const Lf={1:"Low Speed",2:"Full Speed",3:"High Speed",4:"Wireless",5:"SuperSpeed",6:"SuperSpeed+"};function Pf(e){return Lf[e]}function Tf(e){return`${e>>8&255}.${e>>4&15}${e&15}`}const Af={class:"settings-section-label flex items-center justify-between gap-2 normal-case"},If={class:"text-base-content/90 text-sm font-semibold tracking-normal"},Nf={key:0,class:"dropdown dropdown-end"},Of={tabindex:"0",class:"dropdown-content menu bg-base-100 rounded-box z-1 mt-1 max-h-80 w-64 flex-nowrap overflow-y-auto p-2 shadow-lg"},$f={key:0,class:"p-2"},Hf={key:0,class:"menu-title"},Ff=["disabled","onClick"],zf={class:"truncate"},Wf={class:"font-mono text-xs opacity-60"},Uf={key:1,class:"menu-title pt-1"},Vf={key:0,class:"alert alert-error alert-soft mb-2 rounded-xl py-2 text-sm"},Kf={class:"break-all"},qf={key:1,class:"bg-base-200/40 text-base-content/50 rounded-xl p-6 text-center text-sm"},Yf={key:2,class:"settings-grid"},jf={class:"flex items-center gap-2.5"},Xf={class:"truncate text-sm font-medium"},Gf={key:0,class:"text-base-content/40 truncate text-xs"},Zf={key:0,class:"text-error pl-[1.125rem] text-xs break-all"},Jf=["title","onClick"],Qf={key:3,class:"text-base-content/50 px-1 pt-2 text-xs"},ep={key:0,class:"flex flex-col gap-4 text-sm"},tp={class:"text-base-content/45 mb-1 px-1 text-xs font-medium"},ip={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},sp={class:"text-base-content/45 mb-1 px-1 text-xs font-medium"},rp={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},np={class:"text-base-content/45 mb-1 px-1 text-xs font-medium"},op={class:"divide-base-content/8 bg-base-200/40 divide-y overflow-hidden rounded-xl"},ap=fe({__name:"UsbipServerPanel",props:{server:{},multiTag:{type:Boolean}},setup(e){const t=e,{t:i}=Ot(),s=Df(t.server.serverTag),r=Q(()=>t.multiTag&&t.server.serverTag?i("usbipServerTagged",{tag:t.server.serverTag}):"USB/IP"),n={attaching:{tone:"medium",key:"usbipStateAttaching"},ready:{tone:"good",key:"usbipStateReady"},error:{tone:"bad",key:"usbipStateError"}},o=f=>{switch(f){case Yi.USB_DEVICE_STATE_IDLE:return{label:i("usbipStateIdle"),tone:"good"};case Yi.USB_DEVICE_STATE_ATTACHED:return{label:i("usbipStateAttached"),tone:"medium"};case Yi.USB_DEVICE_STATE_UNAVAILABLE:return{label:i("usbipStateUnavailable"),tone:"bad"}}},a=f=>{switch(f){case ui.USB_BACKEND_LINUX_SYSFS:return"linux-sysfs";case ui.USB_BACKEND_DYNAMIC:return"dynamic";case ui.USB_BACKEND_DARWIN_IOKIT:return"darwin-iokit";case ui.USB_BACKEND_WINDOWS_VBOXUSB:return"windows-vboxusb";default:return}},h=f=>{switch(f){case"good":return"bg-success";case"medium":return"bg-warning";case"bad":return"bg-error";default:return"bg-base-content/20"}},l=Q(()=>{const f=new Map;for(const V of s.devices.value)V.state==="ready"&&V.busId&&f.set(V.busId,V);const L=new Set,B=new Set(s.detachedBusIds.value),U=[];for(const V of t.server.devices){const F=V.descriptor,R=V.busId?f.get(V.busId):void 0;!R&&B.has(V.busId)||(R&&L.add(R.deviceId),U.push({key:V.stableId||V.busId,name:F?.product||(F?It(F.vendorId,F.productId):V.busId),vidPid:F?It(F.vendorId,F.productId):void 0,busId:V.busId,backend:a(V.backend),state:o(V.state),descriptor:F,onDetach:R?()=>s.detach(R.deviceId):void 0}))}for(const V of s.devices.value)L.has(V.deviceId)||U.push({key:`provided-${V.deviceId}`,name:V.label,vidPid:It(V.vendorId,V.productId),busId:V.state==="ready"?V.busId:void 0,state:{label:i(n[V.state].key),tone:n[V.state].tone},error:V.state==="error"?V.error:void 0,onDetach:()=>s.detach(V.deviceId)});return U}),d=q(null),c=()=>{d.value=null,s.listPermitted().then(f=>d.value=f,()=>d.value=[])},u=()=>{document.activeElement?.blur()},v=f=>{const L=f instanceof Error?f.message:String(f);tr({content:L,type:"alert-error"})},_=f=>{u(),s.attachPermitted(f.device).catch(v)},m=()=>{u(),s.connectNew().catch(v)},C=q(),M=q(!1),H=f=>{C.value=f,M.value=!0},I=Q(()=>C.value?.descriptor?Pf(C.value.descriptor.speed):void 0);return(f,L)=>(g(),x(ie,null,[p("div",Af,[p("span",If,E(r.value),1),A(s).available.value?(g(),x("div",Nf,[p("button",{tabindex:"0",class:"text-primary hover:bg-primary/10 flex items-center gap-1 rounded-md px-2 py-1 text-xs font-medium tracking-normal transition-colors",onClick:c},[Y(A(ds),{class:"h-4 w-4"}),ue(" "+E(f.$t("usbipConnectDevice")),1)]),p("ul",Of,[d.value===null?(g(),x("li",$f,[...L[1]||(L[1]=[p("span",{class:"loading loading-spinner loading-sm mx-auto"},null,-1)])])):(g(),x(ie,{key:1},[d.value.length>0?(g(),x("li",Hf,E(f.$t("usbipAuthorizedDevices")),1)):W("",!0),(g(!0),x(ie,null,ve(d.value,(B,U)=>(g(),x("li",{key:`${B.vidPid}-${U}`},[p("button",{disabled:B.attached,class:"flex items-center justify-between gap-2",onClick:V=>_(B)},[p("span",zf,E(B.label),1),p("span",Wf,E(B.vidPid),1)],8,Ff)]))),128)),d.value.length>0?(g(),x("li",Uf)):W("",!0),p("li",null,[p("button",{class:"gap-2",onClick:m},[Y(A(ds),{class:"h-4 w-4"}),ue(" "+E(f.$t("usbipOtherDevice")),1)])])],64))])])):W("",!0)]),A(s).endError.value?(g(),x("div",Vf,[Y(A(ha),{class:"h-4 w-4 flex-shrink-0"}),p("span",Kf,E(A(s).endError.value),1)])):W("",!0),l.value.length===0?(g(),x("div",qf,E(A(s).available.value?f.$t("usbipPickDeviceHint"):f.$t("usbipNoDevicesShared")),1)):(g(),x("div",Yf,[(g(!0),x(ie,null,ve(l.value,B=>(g(),x("div",{key:B.key,class:"setting-item"},[(g(),j(Rn(B.descriptor?"button":"div"),{class:"flex min-w-0 flex-1 flex-col gap-0.5 text-left",onClick:U=>B.descriptor&&H(B)},{default:J(()=>[p("div",jf,[p("span",{class:Ne(["inline-block h-2 w-2 shrink-0 rounded-full",h(B.state?.tone)])},null,2),p("span",Xf,E(B.name),1),B.state?(g(),x("span",Gf,E(B.state.label),1)):W("",!0)]),B.error?(g(),x("div",Zf,E(B.error),1)):W("",!0)]),_:2},1032,["onClick"])),B.onDetach?(g(),x("button",{key:0,class:"text-error/80 hover:bg-error/10 shrink-0 rounded-md p-1 transition-colors",title:f.$t("usbipDetach"),onClick:U=>B.onDetach()},[Y(A(cs),{class:"h-4 w-4"})],8,Jf)):W("",!0),B.descriptor?(g(),j(A(Ci),{key:1,class:"text-base-content/25 h-4 w-4 shrink-0 cursor-pointer",onClick:U=>H(B)},null,8,["onClick"])):W("",!0)]))),128))])),A(s).available.value?W("",!0):(g(),x("div",Qf,E(A(s).reason.value==="insecure"?f.$t("usbipInsecureContext"):f.$t("usbipUnsupportedBrowser")),1)),Y($t,{modelValue:M.value,"onUpdate:modelValue":L[0]||(L[0]=B=>M.value=B),title:C.value?.name??""},{default:J(()=>[C.value?.descriptor?(g(),x("div",ep,[p("div",null,[p("div",tp,E(f.$t("usbipIdentity")),1),p("div",ip,[C.value.descriptor.product?(g(),j(Ke,{key:0,label:f.$t("usbipProduct"),value:C.value.descriptor.product},null,8,["label","value"])):W("",!0),C.value.vidPid?(g(),j(Ke,{key:1,label:"VID:PID",value:C.value.vidPid,mono:""},null,8,["value"])):W("",!0),C.value.descriptor.serial?(g(),j(Ke,{key:2,label:f.$t("usbipSerialNumber"),value:C.value.descriptor.serial,mono:""},null,8,["label","value"])):W("",!0),C.value.descriptor.bcdDevice>0?(g(),j(Ke,{key:3,label:f.$t("usbipVersion"),value:A(Tf)(C.value.descriptor.bcdDevice),mono:""},null,8,["label","value"])):W("",!0)])]),p("div",null,[p("div",sp,E(f.$t("usbipConnection")),1),p("div",rp,[C.value.busId?(g(),j(Ke,{key:0,label:f.$t("usbipBusId"),value:C.value.busId,mono:""},null,8,["label","value"])):W("",!0),C.value.backend?(g(),j(Ke,{key:1,label:f.$t("usbipBackend"),value:C.value.backend,mono:""},null,8,["label","value"])):W("",!0),I.value?(g(),j(Ke,{key:2,label:f.$t("usbipSpeed"),value:I.value},null,8,["label","value"])):W("",!0),C.value.descriptor.busNum>0||C.value.descriptor.devNum>0?(g(),j(Ke,{key:3,label:f.$t("usbipBusDevice"),value:`${C.value.descriptor.busNum} · ${C.value.descriptor.devNum}`,mono:""},null,8,["label","value"])):W("",!0)])]),p("div",null,[p("div",np,E(f.$t("usbipClassInterfaces")),1),p("div",op,[Y(Ke,{label:f.$t("usbipDeviceClass"),value:C.value.descriptor.deviceClass===0?f.$t("usbipDefinedAtInterface"):A(Dn)(C.value.descriptor.deviceClass,C.value.descriptor.deviceSubClass,C.value.descriptor.deviceProtocol),mono:C.value.descriptor.deviceClass!==0},null,8,["label","value","mono"]),C.value.descriptor.numConfigurations>0?(g(),j(Ke,{key:0,label:f.$t("usbipConfigurations"),value:String(C.value.descriptor.numConfigurations),mono:""},null,8,["label","value"])):W("",!0),(g(!0),x(ie,null,ve(C.value.descriptor.interfaces,(B,U)=>(g(),j(Ke,{key:U,label:f.$t("usbipInterfaceN",{n:U+1}),value:A(Dn)(B.interfaceClass,B.interfaceSubClass,B.interfaceProtocol),mono:""},null,8,["label","value"]))),128))])])])):W("",!0)]),_:1},8,["modelValue","title"])],64))}}),lp={class:"mx-auto flex max-w-2xl flex-col p-2 sm:p-4"},hp={key:0,class:"text-base-content/50 p-12 text-center text-sm"},cp=fe({__name:"UsbipPanel",setup(e){const t=q([]);let i=null;return Ht(()=>{Bt()&&(i=ir(s=>sr(rr.method.subscribeUSBIPServerStatus,{},s),s=>t.value=s.servers))}),ot(()=>i?.close()),(s,r)=>(g(),x("div",lp,[t.value.length===0?(g(),x("div",hp,E(s.$t("usbipNoServer")),1)):W("",!0),(g(!0),x(ie,null,ve(t.value,n=>(g(),j(ap,{key:n.serverTag,server:n,"multi-tag":t.value.length>1},null,8,["server","multi-tag"]))),128))]))}}),dp={class:"relative flex h-full min-h-0 flex-col"},up={class:"flex items-center gap-2 p-2"},_p={key:0,class:"absolute inset-0 z-200"},fp=2,mp=fe({__name:"ToolsPage",setup(e){const{t}=Ot(),i=q("tools"),s=Q(()=>ra.value>=fp),r=Q(()=>[{value:"tools",label:t("tools"),icon:na},...s.value?[{value:"usbip",label:t("usbip"),icon:oa}]:[],{value:"tailscale",label:t("tailscale"),icon:da}]);Ze(s,h=>{!h&&i.value==="usbip"&&(i.value="tools")});const{padding:n}=ea({offsetTop:0,offsetBottom:8}),o=q(),a=h=>{o.value={...h,seq:(o.value?.seq??0)+1}};return(h,l)=>(g(),x("div",dp,[Y(ta,null,{default:J(()=>[p("div",up,[Y(sa,{modelValue:i.value,"onUpdate:modelValue":l[0]||(l[0]=d=>i.value=d),options:r.value},null,8,["modelValue","options"])])]),_:1}),p("div",{class:"min-h-0 flex-1 overflow-y-auto",style:Ln(A(n))},[(g(),j(ia,null,[i.value==="tools"?(g(),j(al,{key:0})):i.value==="usbip"?(g(),j(cp,{key:1})):(g(),j(Xh,{key:2,onSsh:a}))],1024))],4),o.value?(g(),x("div",_p,[Y(sf,{launch:o.value,onClose:l[1]||(l[1]=d=>o.value=void 0)},null,8,["launch"])])):W("",!0)]))}});export{mp as default}; diff --git a/src/module/bin/zashboard/assets/clash-C0zJ2EIl.js b/src/module/bin/zashboard/assets/clash-C0zJ2EIl.js new file mode 100644 index 0000000..02e8ef0 --- /dev/null +++ b/src/module/bin/zashboard/assets/clash-C0zJ2EIl.js @@ -0,0 +1,2 @@ +import{al as q,am as L,an as E,aj as R,x as h,ao as _,ap as $,aq as H,ar as b,ak as x,ai as W,as as O,at as P,au as y,av as Y,aw as K,ad as U,ae as Q,af as V,ag as J,ax as X,ay as N,az as Z,aA as G,aB as C,aC as S,aD as T,aE as v,aF as ee,K as p,aG as te,aH as ae,aI as se,aJ as ne,aK as ie}from"./index-BFzolhRl.js";class oe{value;next;constructor(t){this.value=t}}class re{#e;#t;#a;constructor(){this.clear()}enqueue(t){const a=new oe(t);this.#e?(this.#t.next=a,this.#t=a):(this.#e=a,this.#t=a),this.#a++}dequeue(){const t=this.#e;if(t)return this.#e=this.#e.next,this.#a--,this.#e||(this.#t=void 0),t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#a=0}get size(){return this.#a}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}*drain(){for(;this.#e;)yield this.dequeue()}}function j(e){let t=!1;if(typeof e=="object"&&({concurrency:e,rejectOnClear:t=!1}=e),A(e),typeof t!="boolean")throw new TypeError("Expected `rejectOnClear` to be a boolean");const a=new re;let s=0;const l=()=>{s0&&(s++,a.dequeue().run())},u=()=>{s--,l()},d=async(n,i,o)=>{const r=(async()=>n(...o))();i(r);try{await r}catch{}u()},c=(n,i,o,r)=>{const m={reject:o};new Promise(M=>{m.run=M,a.enqueue(m)}).then(d.bind(void 0,n,i,r)),snew Promise((o,r)=>{c(n,o,r,i)});return Object.defineProperties(f,{activeCount:{get:()=>s},pendingCount:{get:()=>a.size},clearQueue:{value(){if(!t){a.clear();return}const n=AbortSignal.abort().reason;for(;a.size>0;)a.dequeue().reject(n)}},concurrency:{get:()=>e,set(n){A(n),e=n,queueMicrotask(()=>{for(;s0;)l()})}},map:{async value(n,i){const o=Array.from(n,(r,m)=>this(i,r,m));return Promise.all(o)}}}),f}function A(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let D=0;const w=async()=>{const e=Date.now();D=e;const[t,a]=await Promise.all([$(),H()]),s=t.data,l=a.data;if(D!==e)return;const u=s.proxies[b]?.all??[],d={},c=Object.values(l.providers).filter(n=>n.name!=="default"&&n.vehicleType!=="Compatible");for(const n of c)for(const i of n.proxies)i["provider-name"]||=n.name,d[i.name]=i;h.value={...d,...s.proxies},R.value=Object.values(s.proxies).filter(n=>n.all?.length&&n.name!==b).sort((n,i)=>{const o=u.indexOf(n.name),r=u.indexOf(i.name);return o===-1&&r===-1?0:o===-1?1:r===-1?-1:o-r}).map(n=>n.name),x.value=c;const f=[];Object.entries(h.value).forEach(([n,i])=>{const o=W.value.find(r=>r.name===n);o&&(h.value[n].icon=o.icon),O.value&&de(i)&&(P.value[n]=!0),i.type.toLowerCase()===y.Smart&&f.push(n)}),f.length>0&&Y(f)},he=async(e,t)=>{const a=h.value[e];a.type.toLowerCase()!==y.LoadBalance&&(a.now===t&&(await w(),a.now===t)||(await K(e,t),h.value[e].now=t,U.value&&Q.value.filter(s=>V(s).includes(e)).forEach(s=>J(s.id)),w()))},le=e=>{const t=h.value[e]?.["provider-name"];return t?x.value.some(a=>a.name===t)?t:"":x.value.find(a=>a.proxies.some(s=>s.name===e))?.name??""},B=(e,t,a)=>{if(!se.value){const s=le(e);if(s)return ne(s,e,t,a)}return ie(e,t,a)},k=async(e,t,a)=>{const s=T(e);if(O.value)try{const{data:l}=await B(s,S,2e3);P.value[s]=l.delay>v}catch{P.value[s]=!1}return await B(E.value?e:s,t,a)},g=(e,t)=>E.value?`${e} +@${t}`:e,ve=async(e,t=q.value,a=L.value)=>{const s=await k(e,t,a);await w(),s.status!==200&&p({content:"testFailedTip",params:{name:g(e,t)},type:"alert-error"})},F=(e,t)=>{const a=ae(e),s=new Date;a.push({time:s.toISOString(),delay:t})},I="testLatencyOneByOneWithTip",ce=j(5),z=async(e,t,a=q.value)=>{const s=t.length;let l=0,u=0;await Promise.allSettled(t.map(d=>ce(async()=>{const c=await k(d,a,Math.min(2e3,L.value));c.status!==200?(u++,F(d,v)):F(d,c.data.delay),l++,p({content:"testFinishedTip",key:I+e,params:{name:g(e,a),total:s.toString(),number:l.toString()},type:"alert-info",timeout:0})}))),p({content:"testFinishedResultTip",key:I+e,params:{name:g(e,a),total:s.toString(),success:`${s-u}`,failed:`${u}`},type:u?"alert-warning":"alert-success",timeout:3e3})},ue=async e=>{const t=h.value[e],a=t.all??[],s=X(e);if(N.value===Z.DASHBOARD&&[y.Selector,y.LoadBalance,y.Smart].includes(t.type.toLowerCase()))return t.fixed&&G(e),z(e,a,s);const l=Math.max(5e3,L.value);if(O.value)try{const{data:c}=await C(e,S,l);a?.forEach(f=>{P.value[T(f)]=c[f]>v})}catch{a?.forEach(c=>{P.value[T(c)]=!1})}await C(e,s,l),await w();const u=a.length,d=a.filter(c=>ee(c,e)===v).length;p({content:"testFinishedResultTip",key:I+e,params:{name:g(e,s),total:u.toString(),success:`${u-d}`,failed:`${d}`},type:d?"alert-warning":"alert-success",timeout:3e3})},ye=async()=>{if(E.value){const t=j(3);return await Promise.all(R.value.map(a=>t(async()=>{await ue(a)})))}const e=Object.keys(h.value).filter(t=>!_(t));return z("all",e)},de=e=>{const t=e.extra?.[S]?.history;return(te.last(t)?.delay??v)>v};export{ye as allProxiesLatencyTest,w as fetchProxies,he as handlerProxySelect,ue as proxyGroupLatencyTest,ve as proxyLatencyTest}; diff --git a/src/module/bin/zashboard/assets/clash-BpP7dn9R.js b/src/module/bin/zashboard/assets/clash-CTy6rUKn.js similarity index 63% rename from src/module/bin/zashboard/assets/clash-BpP7dn9R.js rename to src/module/bin/zashboard/assets/clash-CTy6rUKn.js index 408990d..7485ab4 100644 --- a/src/module/bin/zashboard/assets/clash-BpP7dn9R.js +++ b/src/module/bin/zashboard/assets/clash-CTy6rUKn.js @@ -1 +1 @@ -import{aI as s,aK as t,aL as o}from"./index-C6lj-lhL.js";const n=async()=>{s.value=(await t()).data},c=async a=>{await o(a),n()};export{n as fetchConfigs,c as updateConfigs}; +import{aL as s,aN as t,aO as o}from"./index-BFzolhRl.js";const n=async()=>{s.value=(await t()).data},c=async a=>{await o(a),n()};export{n as fetchConfigs,c as updateConfigs}; diff --git a/src/module/bin/zashboard/assets/clash-DnQc_SsP.js b/src/module/bin/zashboard/assets/clash-DnQc_SsP.js deleted file mode 100644 index 7ceb67c..0000000 --- a/src/module/bin/zashboard/assets/clash-DnQc_SsP.js +++ /dev/null @@ -1,2 +0,0 @@ -import{aj as q,ak as I,al as L,ah as R,A as h,am as M,an as _,ao as $,ap as b,ai as H,aq as W,ar as E,as as w,at as y,au as Y,av as U,ad as Q,ae as V,af as K,ag as N,aw as X,ax as J,ay as Z,az as G,aA as S,aB as O,aC as x,aD as v,aE as ee,N as P,aF as te,aG as C,aH as ae}from"./index-C6lj-lhL.js";class se{value;next;constructor(t){this.value=t}}class ie{#e;#t;#a;constructor(){this.clear()}enqueue(t){const a=new se(t);this.#e?(this.#t.next=a,this.#t=a):(this.#e=a,this.#t=a),this.#a++}dequeue(){const t=this.#e;if(t)return this.#e=this.#e.next,this.#a--,this.#e||(this.#t=void 0),t.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#a=0}get size(){return this.#a}*[Symbol.iterator](){let t=this.#e;for(;t;)yield t.value,t=t.next}*drain(){for(;this.#e;)yield this.dequeue()}}function j(e){let t=!1;if(typeof e=="object"&&({concurrency:e,rejectOnClear:t=!1}=e),A(e),typeof t!="boolean")throw new TypeError("Expected `rejectOnClear` to be a boolean");const a=new ie;let s=0;const l=()=>{s0&&(s++,a.dequeue().run())},u=()=>{s--,l()},f=async(i,n,o)=>{const r=(async()=>i(...o))();n(r);try{await r}catch{}u()},c=(i,n,o,r)=>{const p={reject:o};new Promise(z=>{p.run=z,a.enqueue(p)}).then(f.bind(void 0,i,n,r)),snew Promise((o,r)=>{c(i,o,r,n)});return Object.defineProperties(d,{activeCount:{get:()=>s},pendingCount:{get:()=>a.size},clearQueue:{value(){if(!t){a.clear();return}const i=AbortSignal.abort().reason;for(;a.size>0;)a.dequeue().reject(i)}},concurrency:{get:()=>e,set(i){A(i),e=i,queueMicrotask(()=>{for(;s0;)l()})}},map:{async value(i,n){const o=Array.from(i,(r,p)=>this(n,r,p));return Promise.all(o)}}}),d}function A(e){if(!((Number.isInteger(e)||e===Number.POSITIVE_INFINITY)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}let D=0;const m=async()=>{const e=Date.now();D=e;const[t,a]=await Promise.all([_(),$()]),s=t.data,l=a.data;if(D!==e)return;const u=s.proxies[b]?.all??[],f={},c=Object.values(l.providers).filter(i=>i.name!=="default"&&i.vehicleType!=="Compatible");for(const i of c)for(const n of i.proxies)f[n.name]=n;h.value={...f,...s.proxies},R.value=Object.values(s.proxies).filter(i=>i.all?.length&&i.name!==b).sort((i,n)=>{const o=u.indexOf(i.name),r=u.indexOf(n.name);return o===-1&&r===-1?0:o===-1?1:r===-1?-1:o-r}).map(i=>i.name),H.value=c;const d=[];Object.entries(h.value).forEach(([i,n])=>{const o=W.value.find(r=>r.name===i);o&&(h.value[i].icon=o.icon),E.value&&re(n)&&(w.value[i]=!0),n.type.toLowerCase()===y.Smart&&d.push(i)}),d.length>0&&Y(d)},ce=async(e,t)=>{const a=h.value[e];a.type.toLowerCase()!==y.LoadBalance&&(a.now===t&&(await m(),a.now===t)||(await U(e,t),h.value[e].now=t,Q.value&&V.value.filter(s=>K(s).includes(e)).forEach(s=>N(s.id)),m()))},B=async(e,t,a)=>{const s=x(e);if(E.value)try{const{data:l}=await C(s,O,2e3);w.value[s]=l.delay>v}catch{w.value[s]=!1}return await C(L.value?e:s,t,a)},g=(e,t)=>L.value?`${e} -@${t}`:e,ue=async(e,t=q.value,a=I.value)=>{const s=await B(e,t,a);await m(),s.status!==200&&P({content:"testFailedTip",params:{name:g(e,t)},type:"alert-error"})},F=(e,t)=>{const a=ae(e),s=new Date;a.push({time:s.toISOString(),delay:t})},T="testLatencyOneByOneWithTip",ne=j(5),k=async(e,t,a=q.value)=>{const s=t.length;let l=0,u=0;await Promise.allSettled(t.map(f=>ne(async()=>{const c=await B(f,a,Math.min(2e3,I.value));c.status!==200?(u++,F(f,v)):F(f,c.data.delay),l++,P({content:"testFinishedTip",key:T+e,params:{name:g(e,a),total:s.toString(),number:l.toString()},type:"alert-info",timeout:0})}))),P({content:"testFinishedResultTip",key:T+e,params:{name:g(e,a),total:s.toString(),success:`${s-u}`,failed:`${u}`},type:u?"alert-warning":"alert-success",timeout:3e3})},oe=async e=>{const t=h.value[e],a=t.all??[],s=X(e);if(J.value===Z.DASHBOARD&&[y.Selector,y.LoadBalance,y.Smart].includes(t.type.toLowerCase()))return t.fixed&&G(e),k(e,a,s);const l=Math.max(5e3,I.value);if(E.value)try{const{data:c}=await S(e,O,l);a?.forEach(d=>{w.value[x(d)]=c[d]>v})}catch{a?.forEach(c=>{w.value[x(c)]=!1})}await S(e,s,l),await m();const u=a.length,f=a.filter(c=>ee(c,e)===v).length;P({content:"testFinishedResultTip",key:T+e,params:{name:g(e,s),total:u.toString(),success:`${u-f}`,failed:`${f}`},type:f?"alert-warning":"alert-success",timeout:3e3})},fe=async()=>{if(L.value){const t=j(3);return await Promise.all(R.value.map(a=>t(async()=>{await oe(a)})))}const e=Object.keys(h.value).filter(t=>!M(t));return k("all",e)},re=e=>{const t=e.extra?.[O]?.history;return(te.last(t)?.delay??v)>v};export{fe as allProxiesLatencyTest,m as fetchProxies,ce as handlerProxySelect,oe as proxyGroupLatencyTest,ue as proxyLatencyTest}; diff --git a/src/module/bin/zashboard/assets/clash-BY687VPW.js b/src/module/bin/zashboard/assets/clash-_C9ygk9m.js similarity index 78% rename from src/module/bin/zashboard/assets/clash-BY687VPW.js rename to src/module/bin/zashboard/assets/clash-_C9ygk9m.js index 5b082a1..4ff8353 100644 --- a/src/module/bin/zashboard/assets/clash-BY687VPW.js +++ b/src/module/bin/zashboard/assets/clash-_C9ygk9m.js @@ -1 +1 @@ -import{aO as o,aP as u,aM as c,aN as i}from"./index-C6lj-lhL.js";const n=async()=>{const{data:r}=await o(),{data:e}=await u();c.value=r.rules.map(t=>{const a=t.proxy,s=a.startsWith("route(")?a.substring(6,a.length-1):a;return{...t,proxy:s}}),i.value=Object.values(e.providers)};export{n as fetchRules}; +import{aR as o,aS as u,aP as c,aQ as i}from"./index-BFzolhRl.js";const n=async()=>{const{data:r}=await o(),{data:e}=await u();c.value=r.rules.map(t=>{const a=t.proxy,s=a.startsWith("route(")?a.substring(6,a.length-1):a;return{...t,proxy:s}}),i.value=Object.values(e.providers)};export{n as fetchRules}; diff --git a/src/module/bin/zashboard/assets/index-BFzolhRl.js b/src/module/bin/zashboard/assets/index-BFzolhRl.js new file mode 100644 index 0000000..76938d0 --- /dev/null +++ b/src/module/bin/zashboard/assets/index-BFzolhRl.js @@ -0,0 +1,163 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ToolsPage-Cu0SeEcm.js","./ToolsPage-DDGTF8rc.css"])))=>i.map(i=>d[i]); +(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();const Kfe="modulepreload",Zfe=function(e,t){return new URL(e,t).href},AB={},es=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){let u=function(c){return Promise.all(c.map(f=>Promise.resolve(f).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const a=document.getElementsByTagName("link"),s=document.querySelector("meta[property=csp-nonce]"),l=s?.nonce||s?.getAttribute("nonce");i=u(n.map(c=>{if(c=Zfe(c,r),c in AB)return;AB[c]=!0;const f=c.endsWith(".css"),h=f?'[rel="stylesheet"]':"";if(r)for(let p=a.length-1;p>=0;p--){const v=a[p];if(v.href===c&&(!f||v.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${h}`))return;const d=document.createElement("link");if(d.rel=f?"stylesheet":Kfe,f||(d.as="script"),d.crossOrigin="",d.href=c,l&&d.setAttribute("nonce",l),document.head.appendChild(d),f)return new Promise((p,v)=>{d.addEventListener("load",p),d.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${c}`)))})}))}function o(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return i.then(a=>{for(const s of a||[])s.status==="rejected"&&o(s.reason);return t().catch(o)})};function Ui(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const gn={},Qh=[],Fi=()=>{},$h=()=>!1,_d=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),w_=e=>e.startsWith("onUpdate:"),pn=Object.assign,aI=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},Jfe=Object.prototype.hasOwnProperty,Mn=(e,t)=>Jfe.call(e,t),gt=Array.isArray,qh=e=>Wp(e)==="[object Map]",Sd=e=>Wp(e)==="[object Set]",wD=e=>Wp(e)==="[object Date]",$7=e=>Wp(e)==="[object RegExp]",Vt=e=>typeof e=="function",zt=e=>typeof e=="string",ro=e=>typeof e=="symbol",On=e=>e!==null&&typeof e=="object",sI=e=>(On(e)||Vt(e))&&Vt(e.then)&&Vt(e.catch),FN=Object.prototype.toString,Wp=e=>FN.call(e),B7=e=>Wp(e).slice(8,-1),x_=e=>Wp(e)==="[object Object]",T_=e=>zt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,lu=Ui(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),V7=Ui("bind,cloak,else-if,else,for,html,if,model,on,once,pre,show,slot,text,memo"),lI=e=>{const t=Object.create(null);return(n=>t[n]||(t[n]=e(n)))},Qfe=/-\w/g,ir=lI(e=>e.replace(Qfe,t=>t.slice(1).toUpperCase())),qfe=/\B([A-Z])/g,wo=lI(e=>e.replace(qfe,"-$1").toLowerCase()),wd=lI(e=>e.charAt(0).toUpperCase()+e.slice(1)),ep=lI(e=>e?`on${wd(e)}`:""),Ei=(e,t)=>!Object.is(e,t),tp=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:n})},E_=e=>{const t=parseFloat(e);return isNaN(t)?e:t},a1=e=>{const t=zt(e)?Number(e):NaN;return isNaN(t)?e:t};let RB;const C_=()=>RB||(RB=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),ede=/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/;function tde(e){return ede.test(e)?`__props.${e}`:`__props[${JSON.stringify(e)}]`}function nde(e,t){return e+JSON.stringify(t,(n,r)=>typeof r=="function"?r.toString():r)}const rde={TEXT:1,1:"TEXT",CLASS:2,2:"CLASS",STYLE:4,4:"STYLE",PROPS:8,8:"PROPS",FULL_PROPS:16,16:"FULL_PROPS",NEED_HYDRATION:32,32:"NEED_HYDRATION",STABLE_FRAGMENT:64,64:"STABLE_FRAGMENT",KEYED_FRAGMENT:128,128:"KEYED_FRAGMENT",UNKEYED_FRAGMENT:256,256:"UNKEYED_FRAGMENT",NEED_PATCH:512,512:"NEED_PATCH",DYNAMIC_SLOTS:1024,1024:"DYNAMIC_SLOTS",DEV_ROOT_FRAGMENT:2048,2048:"DEV_ROOT_FRAGMENT",CACHED:-1,"-1":"CACHED",BAIL:-2,"-2":"BAIL"},ide={1:"TEXT",2:"CLASS",4:"STYLE",8:"PROPS",16:"FULL_PROPS",32:"NEED_HYDRATION",64:"STABLE_FRAGMENT",128:"KEYED_FRAGMENT",256:"UNKEYED_FRAGMENT",512:"NEED_PATCH",1024:"DYNAMIC_SLOTS",2048:"DEV_ROOT_FRAGMENT",[-1]:"CACHED",[-2]:"BAIL"},ode={ELEMENT:1,1:"ELEMENT",FUNCTIONAL_COMPONENT:2,2:"FUNCTIONAL_COMPONENT",STATEFUL_COMPONENT:4,4:"STATEFUL_COMPONENT",TEXT_CHILDREN:8,8:"TEXT_CHILDREN",ARRAY_CHILDREN:16,16:"ARRAY_CHILDREN",SLOTS_CHILDREN:32,32:"SLOTS_CHILDREN",TELEPORT:64,64:"TELEPORT",SUSPENSE:128,128:"SUSPENSE",COMPONENT_SHOULD_KEEP_ALIVE:256,256:"COMPONENT_SHOULD_KEEP_ALIVE",COMPONENT_KEPT_ALIVE:512,512:"COMPONENT_KEPT_ALIVE",COMPONENT:6,6:"COMPONENT"},ade={STABLE:1,1:"STABLE",DYNAMIC:2,2:"DYNAMIC",FORWARDED:3,3:"FORWARDED"},sde={1:"STABLE",2:"DYNAMIC",3:"FORWARDED"},lde="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console,Error,Symbol",BN=Ui(lde),ude=BN,kB=2;function U7(e,t=0,n=e.length){if(t=Math.max(0,Math.min(t,e.length)),n=Math.max(0,Math.min(n,e.length)),t>n)return"";let r=e.split(/(\r?\n)/);const i=r.filter((s,l)=>l%2===1);r=r.filter((s,l)=>l%2===0);let o=0;const a=[];for(let s=0;s=t){for(let l=s-kB;l<=s+kB||n>o;l++){if(l<0||l>=r.length)continue;const u=l+1;a.push(`${u}${" ".repeat(Math.max(3-String(u).length,0))}| ${r[l]}`);const c=r[l].length,f=i[l]&&i[l].length||0;if(l===s){const h=t-(o-(c+f)),d=Math.max(1,n>o?c-h:n-t);a.push(" | "+" ".repeat(h)+"^".repeat(d))}else if(l>s){if(n>o){const h=Math.max(Math.min(n-o,c),1);a.push(" | "+"^".repeat(h))}o+=c+f}}break}return a.join(` +`)}function sn(e){if(gt(e)){const t={};for(let n=0;n{if(n){const r=n.split(fde);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function hde(e){if(!e)return"";if(zt(e))return e;let t="";for(const n in e){const r=e[n];if(zt(r)||typeof r=="number"){const i=n.startsWith("--")?n:wo(n);t+=`${i}:${r};`}}return t}function tt(e){let t="";if(zt(e))t=e;else if(gt(e))for(let n=0;n/="'\u0009\u000a\u000c\u0020]/,gR={};function _de(e){if(gR.hasOwnProperty(e))return gR[e];const t=bde.test(e);return t&&console.error(`unsafe attribute name: ${e}`),gR[e]=!t}const Sde={acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},wde=Ui("accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,inert,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap"),xde=Ui("xmlns,accent-height,accumulate,additive,alignment-baseline,alphabetic,amplitude,arabic-form,ascent,attributeName,attributeType,azimuth,baseFrequency,baseline-shift,baseProfile,bbox,begin,bias,by,calcMode,cap-height,class,clip,clipPathUnits,clip-path,clip-rule,color,color-interpolation,color-interpolation-filters,color-profile,color-rendering,contentScriptType,contentStyleType,crossorigin,cursor,cx,cy,d,decelerate,descent,diffuseConstant,direction,display,divisor,dominant-baseline,dur,dx,dy,edgeMode,elevation,enable-background,end,exponent,fill,fill-opacity,fill-rule,filter,filterRes,filterUnits,flood-color,flood-opacity,font-family,font-size,font-size-adjust,font-stretch,font-style,font-variant,font-weight,format,from,fr,fx,fy,g1,g2,glyph-name,glyph-orientation-horizontal,glyph-orientation-vertical,glyphRef,gradientTransform,gradientUnits,hanging,height,href,hreflang,horiz-adv-x,horiz-origin-x,id,ideographic,image-rendering,in,in2,intercept,k,k1,k2,k3,k4,kernelMatrix,kernelUnitLength,kerning,keyPoints,keySplines,keyTimes,lang,lengthAdjust,letter-spacing,lighting-color,limitingConeAngle,local,marker-end,marker-mid,marker-start,markerHeight,markerUnits,markerWidth,mask,maskContentUnits,maskUnits,mathematical,max,media,method,min,mode,name,numOctaves,offset,opacity,operator,order,orient,orientation,origin,overflow,overline-position,overline-thickness,panose-1,paint-order,path,pathLength,patternContentUnits,patternTransform,patternUnits,ping,pointer-events,points,pointsAtX,pointsAtY,pointsAtZ,preserveAlpha,preserveAspectRatio,primitiveUnits,r,radius,referrerPolicy,refX,refY,rel,rendering-intent,repeatCount,repeatDur,requiredExtensions,requiredFeatures,restart,result,rotate,rx,ry,scale,seed,shape-rendering,slope,spacing,specularConstant,specularExponent,speed,spreadMethod,startOffset,stdDeviation,stemh,stemv,stitchTiles,stop-color,stop-opacity,strikethrough-position,strikethrough-thickness,string,stroke,stroke-dasharray,stroke-dashoffset,stroke-linecap,stroke-linejoin,stroke-miterlimit,stroke-opacity,stroke-width,style,surfaceScale,systemLanguage,tabindex,tableValues,target,targetX,targetY,text-anchor,text-decoration,text-rendering,textLength,to,transform,transform-origin,type,u1,u2,underline-position,underline-thickness,unicode,unicode-bidi,unicode-range,units-per-em,v-alphabetic,v-hanging,v-ideographic,v-mathematical,values,vector-effect,version,vert-adv-y,vert-origin-x,vert-origin-y,viewBox,viewTarget,visibility,width,widths,word-spacing,writing-mode,x,x-height,x1,x2,xChannelSelector,xlink:actuate,xlink:arcrole,xlink:href,xlink:role,xlink:show,xlink:title,xlink:type,xmlns:xlink,xml:base,xml:lang,xml:space,y,y1,y2,yChannelSelector,z,zoomAndPan"),Tde=Ui("accent,accentunder,actiontype,align,alignmentscope,altimg,altimg-height,altimg-valign,altimg-width,alttext,bevelled,close,columnsalign,columnlines,columnspan,denomalign,depth,dir,display,displaystyle,encoding,equalcolumns,equalrows,fence,fontstyle,fontweight,form,frame,framespacing,groupalign,height,href,id,indentalign,indentalignfirst,indentalignlast,indentshift,indentshiftfirst,indentshiftlast,indextype,justify,largetop,largeop,lquote,lspace,mathbackground,mathcolor,mathsize,mathvariant,maxsize,minlabelspacing,mode,other,overflow,position,rowalign,rowlines,rowspan,rquote,rspace,scriptlevel,scriptminsize,scriptsizemultiplier,selection,separator,separators,shift,side,src,stackalign,stretchy,subscriptshift,superscriptshift,symmetric,voffset,width,widths,xlink:href,xlink:show,xlink:type,xmlns");function Ede(e){if(e==null)return!1;const t=typeof e;return t==="string"||t==="number"||t==="boolean"}const Cde=/["'&<>]/;function Ide(e){const t=""+e,n=Cde.exec(t);if(!n)return t;let r="",i,o,a=0;for(o=n.index;o||--!>|?@[\\\]^`{|}~]/g;function kde(e,t){return e.replace(K7,n=>t?n==='"'?'\\\\\\"':`\\\\${n}`:`\\${n}`)}function Pde(e,t){if(e.length!==t.length)return!1;let n=!0;for(let r=0;n&&rbu(n,t))}const Z7=e=>!!(e&&e.__v_isRef===!0),K=e=>zt(e)?e:e==null?"":gt(e)||On(e)&&(e.toString===FN||!Vt(e.toString))?Z7(e)?K(e.value):JSON.stringify(e,J7,2):String(e),J7=(e,t)=>Z7(t)?J7(e,t.value):qh(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[r,i],o)=>(n[mR(r,o)+" =>"]=i,n),{})}:Sd(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>mR(n))}:ro(t)?mR(t):On(t)&&!gt(t)&&!x_(t)?String(t):t,mR=(e,t="")=>{var n;return ro(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};function Q7(e){return e==null?"initial":typeof e=="string"?e===""?" ":e:String(e)}const Dde=Object.freeze(Object.defineProperty({__proto__:null,EMPTY_ARR:Qh,EMPTY_OBJ:gn,NO:$h,NOOP:Fi,PatchFlagNames:ide,PatchFlags:rde,ShapeFlags:ode,SlotFlags:ade,camelize:ir,capitalize:wd,cssVarNameEscapeSymbolsRE:K7,def:$N,escapeHtml:Ide,escapeHtmlComment:Rde,extend:pn,genCacheKey:nde,genPropsAccessExp:tde,generateCodeFrame:U7,getEscapedCssVarName:kde,getGlobalThis:C_,hasChanged:Ei,hasOwn:Mn,hyphenate:wo,includeBooleanAttr:UN,invokeArrayFns:tp,isArray:gt,isBooleanAttr:yde,isBuiltInDirective:V7,isDate:wD,isFunction:Vt,isGloballyAllowed:BN,isGloballyWhitelisted:ude,isHTMLTag:H7,isIntegerKey:T_,isKnownHtmlAttr:wde,isKnownMathMLAttr:Tde,isKnownSvgAttr:xde,isMap:qh,isMathMLTag:z7,isModelListener:w_,isObject:On,isOn:_d,isPlainObject:x_,isPromise:sI,isRegExp:$7,isRenderableAttrValue:Ede,isReservedProp:lu,isSSRSafeAttrName:_de,isSVGTag:W7,isSet:Sd,isSpecialBooleanAttr:X7,isString:zt,isSymbol:ro,isVoidTag:Y7,looseEqual:bu,looseIndexOf:I_,looseToNumber:E_,makeMap:Ui,normalizeClass:tt,normalizeCssVarValue:Q7,normalizeProps:G7,normalizeStyle:sn,objectToString:FN,parseStringStyle:VN,propsToAttrMap:Sde,remove:aI,slotFlagsText:sde,stringifyStyle:hde,toDisplayString:K,toHandlerKey:ep,toNumber:a1,toRawType:B7,toTypeString:Wp},Symbol.toStringTag,{value:"Module"}));let xi;class GN{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this._warnOnRun=!0,this.__v_skip=!0,!t&&xi&&(xi.active?(this.parent=xi,this.index=(xi.scopes||(xi.scopes=[])).push(this)-1):(this._active=!1,this._warnOnRun=!1))}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0){if(xi===this)xi=this.prevScope;else{let t=xi;for(;t;){if(t.prevScope===this){t.prevScope=this.prevScope;break}t=t.prevScope}}this.prevScope=void 0}}stop(t){if(this._active){this._active=!1;let n,r;for(n=0,r=this.effects.length;n0)return;if(bb){let t=bb;for(bb=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;yb;){let t=yb;for(yb=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=n}}if(e)throw e}function nY(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function rY(e){let t,n=e.depsTail,r=n;for(;r;){const i=r.prevDep;r.version===-1?(r===n&&(n=i),zN(r),Ode(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=i}e.deps=t,e.depsTail=n}function xD(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(iY(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function iY(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===l1)||(e.globalVersion=l1,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!xD(e))))return;e.flags|=2;const t=e.dep,n=br,r=ul;br=e,ul=!0;try{nY(e);const i=e.fn(e._value);(t.version===0||Ei(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{br=n,ul=r,rY(e),e.flags&=-3}}function zN(e,t=!1){const{dep:n,prevSub:r,nextSub:i}=e;if(r&&(r.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=r,e.nextSub=void 0),n.subs===e&&(n.subs=r,!r&&n.computed)){n.computed.flags&=-5;for(let o=n.computed.deps;o;o=o.nextDep)zN(o,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ode(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}function Lde(e,t){e.effect instanceof s1&&(e=e.effect.fn);const n=new s1(e);t&&pn(n,t);try{n.run()}catch(i){throw n.stop(),i}const r=n.run.bind(n);return r.effect=n,r}function Nde(e){e.effect.stop()}let ul=!0;const oY=[];function Oc(){oY.push(ul),ul=!1}function Lc(){const e=oY.pop();ul=e===void 0?!0:e}function PB(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=br;br=void 0;try{t()}finally{br=n}}}let l1=0;class Mde{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class uI{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!br||!ul||br===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==br)n=this.activeLink=new Mde(br,this),br.deps?(n.prevDep=br.depsTail,br.depsTail.nextDep=n,br.depsTail=n):br.deps=br.depsTail=n,aY(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const r=n.nextDep;r.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=r),n.prevDep=br.depsTail,n.nextDep=void 0,br.depsTail.nextDep=n,br.depsTail=n,br.deps===n&&(br.deps=r)}return n}trigger(t){this.version++,l1++,this.notify(t)}notify(t){HN();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{WN()}}}function aY(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)aY(r)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const _E=new WeakMap,np=Symbol(""),TD=Symbol(""),u1=Symbol("");function _o(e,t,n){if(ul&&br){let r=_E.get(e);r||_E.set(e,r=new Map);let i=r.get(n);i||(r.set(n,i=new uI),i.map=r,i.key=n),i.track()}}function ic(e,t,n,r,i,o){const a=_E.get(e);if(!a){l1++;return}const s=l=>{l&&l.trigger()};if(HN(),t==="clear")a.forEach(s);else{const l=gt(e),u=l&&T_(n);if(l&&n==="length"){const c=Number(r);a.forEach((f,h)=>{(h==="length"||h===u1||!ro(h)&&h>=c)&&s(f)})}else switch((n!==void 0||a.has(void 0))&&s(a.get(n)),u&&s(a.get(u1)),t){case"add":l?u&&s(a.get("length")):(s(a.get(np)),qh(e)&&s(a.get(TD)));break;case"delete":l||(s(a.get(np)),qh(e)&&s(a.get(TD)));break;case"set":qh(e)&&s(a.get(np));break}}WN()}function Fde(e,t){const n=_E.get(e);return n&&n.get(t)}function Tv(e){const t=In(e);return t===e?t:(_o(t,"iterate",u1),Ta(e)?t:t.map(pl))}function cI(e){return _o(e=In(e),"iterate",u1),e}function Zl(e,t){return _u(e)?rm(yc(e)?pl(t):t):pl(t)}const $de={__proto__:null,[Symbol.iterator](){return bR(this,Symbol.iterator,e=>Zl(this,e))},concat(...e){return Tv(this).concat(...e.map(t=>gt(t)?Tv(t):t))},entries(){return bR(this,"entries",e=>(e[1]=Zl(this,e[1]),e))},every(e,t){return Gu(this,"every",e,t,void 0,arguments)},filter(e,t){return Gu(this,"filter",e,t,n=>n.map(r=>Zl(this,r)),arguments)},find(e,t){return Gu(this,"find",e,t,n=>Zl(this,n),arguments)},findIndex(e,t){return Gu(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Gu(this,"findLast",e,t,n=>Zl(this,n),arguments)},findLastIndex(e,t){return Gu(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Gu(this,"forEach",e,t,void 0,arguments)},includes(...e){return _R(this,"includes",e)},indexOf(...e){return _R(this,"indexOf",e)},join(e){return Tv(this).join(e)},lastIndexOf(...e){return _R(this,"lastIndexOf",e)},map(e,t){return Gu(this,"map",e,t,void 0,arguments)},pop(){return e0(this,"pop")},push(...e){return e0(this,"push",e)},reduce(e,...t){return DB(this,"reduce",e,t)},reduceRight(e,...t){return DB(this,"reduceRight",e,t)},shift(){return e0(this,"shift")},some(e,t){return Gu(this,"some",e,t,void 0,arguments)},splice(...e){return e0(this,"splice",e)},toReversed(){return Tv(this).toReversed()},toSorted(e){return Tv(this).toSorted(e)},toSpliced(...e){return Tv(this).toSpliced(...e)},unshift(...e){return e0(this,"unshift",e)},values(){return bR(this,"values",e=>Zl(this,e))}};function bR(e,t,n){const r=cI(e),i=r[t]();return r!==e&&!Ta(e)&&(i._next=i.next,i.next=()=>{const o=i._next();return o.done||(o.value=n(o.value)),o}),i}const Bde=Array.prototype;function Gu(e,t,n,r,i,o){const a=cI(e),s=a!==e&&!Ta(e),l=a[t];if(l!==Bde[t]){const f=l.apply(e,o);return s?pl(f):f}let u=n;a!==e&&(s?u=function(f,h){return n.call(this,Zl(e,f),h,e)}:n.length>2&&(u=function(f,h){return n.call(this,f,h,e)}));const c=l.call(a,u,r);return s&&i?i(c):c}function DB(e,t,n,r){const i=cI(e),o=i!==e&&!Ta(e);let a=n,s=!1;i!==e&&(o?(s=r.length===0,a=function(u,c,f){return s&&(s=!1,u=Zl(e,u)),n.call(this,u,Zl(e,c),f,e)}):n.length>3&&(a=function(u,c,f){return n.call(this,u,c,f,e)}));const l=i[t](a,...r);return s?Zl(e,l):l}function _R(e,t,n){const r=In(e);_o(r,"iterate",u1);const i=r[t](...n);return(i===-1||i===!1)&&k_(n[0])?(n[0]=In(n[0]),r[t](...n)):i}function e0(e,t,n=[]){Oc(),HN();const r=In(e)[t].apply(e,n);return WN(),Lc(),r}const Vde=Ui("__proto__,__v_isRef,__isVue"),sY=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(ro));function Ude(e){ro(e)||(e=String(e));const t=In(this);return _o(t,"has",e),t.hasOwnProperty(e)}class lY{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,r){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,o=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return o;if(n==="__v_raw")return r===(i?o?pY:hY:o?dY:fY).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const a=gt(t);if(!i){let l;if(a&&(l=$de[n]))return l;if(n==="hasOwnProperty")return Ude}const s=Reflect.get(t,n,st(t)?t:r);if((ro(n)?sY.has(n):Vde(n))||(i||_o(t,"get",n),o))return s;if(st(s)){const l=a&&T_(n)?s:s.value;return i&&On(l)?nm(l):l}return On(s)?i?nm(s):io(s):s}}class uY extends lY{constructor(t=!1){super(!1,t)}set(t,n,r,i){let o=t[n];const a=gt(t)&&T_(n);if(!this._isShallow){const u=_u(o);if(!Ta(r)&&!_u(r)&&(o=In(o),r=In(r)),!a&&st(o)&&!st(r))return u||(o.value=r),!0}const s=a?Number(n)e,pw=e=>Reflect.getPrototypeOf(e);function Yde(e,t,n){return function(...r){const i=this.__v_raw,o=In(i),a=qh(o),s=e==="entries"||e===Symbol.iterator&&a,l=e==="keys"&&a,u=i[e](...r),c=n?ED:t?rm:pl;return!t&&_o(o,"iterate",l?TD:np),pn(Object.create(u),{next(){const{value:f,done:h}=u.next();return h?{value:f,done:h}:{value:s?[c(f[0]),c(f[1])]:c(f),done:h}}})}}function vw(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function jde(e,t){const n={get(i){const o=this.__v_raw,a=In(o),s=In(i);e||(Ei(i,s)&&_o(a,"get",i),_o(a,"get",s));const{has:l}=pw(a),u=t?ED:e?rm:pl;if(l.call(a,i))return u(o.get(i));if(l.call(a,s))return u(o.get(s));o!==a&&o.get(i)},get size(){const i=this.__v_raw;return!e&&_o(In(i),"iterate",np),i.size},has(i){const o=this.__v_raw,a=In(o),s=In(i);return e||(Ei(i,s)&&_o(a,"has",i),_o(a,"has",s)),i===s?o.has(i):o.has(i)||o.has(s)},forEach(i,o){const a=this,s=a.__v_raw,l=In(s),u=t?ED:e?rm:pl;return!e&&_o(l,"iterate",np),s.forEach((c,f)=>i.call(o,u(c),u(f),a))}};return pn(n,e?{add:vw("add"),set:vw("set"),delete:vw("delete"),clear:vw("clear")}:{add(i){const o=In(this),a=pw(o),s=In(i),l=!t&&!Ta(i)&&!_u(i)?s:i;return a.has.call(o,l)||Ei(i,l)&&a.has.call(o,i)||Ei(s,l)&&a.has.call(o,s)||(o.add(l),ic(o,"add",l,l)),this},set(i,o){!t&&!Ta(o)&&!_u(o)&&(o=In(o));const a=In(this),{has:s,get:l}=pw(a);let u=s.call(a,i);u||(i=In(i),u=s.call(a,i));const c=l.call(a,i);return a.set(i,o),u?Ei(o,c)&&ic(a,"set",i,o):ic(a,"add",i,o),this},delete(i){const o=In(this),{has:a,get:s}=pw(o);let l=a.call(o,i);l||(i=In(i),l=a.call(o,i)),s&&s.call(o,i);const u=o.delete(i);return l&&ic(o,"delete",i,void 0),u},clear(){const i=In(this),o=i.size!==0,a=i.clear();return o&&ic(i,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Yde(i,e,t)}),n}function fI(e,t){const n=jde(e,t);return(r,i,o)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?r:Reflect.get(Mn(n,i)&&i in r?n:r,i,o)}const Xde={get:fI(!1,!1)},Kde={get:fI(!1,!0)},Zde={get:fI(!0,!1)},Jde={get:fI(!0,!0)},fY=new WeakMap,dY=new WeakMap,hY=new WeakMap,pY=new WeakMap;function Qde(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function io(e){return _u(e)?e:dI(e,!1,Gde,Xde,fY)}function YN(e){return dI(e,!1,Wde,Kde,dY)}function nm(e){return dI(e,!0,Hde,Zde,hY)}function Pg(e){return dI(e,!0,zde,Jde,pY)}function dI(e,t,n,r,i){if(!On(e)||e.__v_raw&&!(t&&e.__v_isReactive)||e.__v_skip||!Object.isExtensible(e))return e;const o=i.get(e);if(o)return o;const a=Qde(B7(e));if(a===0)return e;const s=new Proxy(e,a===2?r:n);return i.set(e,s),s}function yc(e){return _u(e)?yc(e.__v_raw):!!(e&&e.__v_isReactive)}function _u(e){return!!(e&&e.__v_isReadonly)}function Ta(e){return!!(e&&e.__v_isShallow)}function k_(e){return e?!!e.__v_raw:!1}function In(e){const t=e&&e.__v_raw;return t?In(t):e}function vY(e){return!Mn(e,"__v_skip")&&Object.isExtensible(e)&&$N(e,"__v_skip",!0),e}const pl=e=>On(e)?io(e):e,rm=e=>On(e)?nm(e):e;function st(e){return e?e.__v_isRef===!0:!1}function me(e){return gY(e,!1)}function mn(e){return gY(e,!0)}function gY(e,t){return st(e)?e:new qde(e,t)}class qde{constructor(t,n){this.dep=new uI,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:In(t),this._value=n?t:pl(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,r=this.__v_isShallow||Ta(t)||_u(t);t=r?t:In(t),Ei(t,n)&&(this._rawValue=t,this._value=r?t:pl(t),this.dep.trigger())}}function CD(e){e.dep&&e.dep.trigger()}function R(e){return st(e)?e.value:e}function lr(e){return Vt(e)?e():R(e)}const ehe={get:(e,t,n)=>t==="__v_raw"?e:R(Reflect.get(e,t,n)),set:(e,t,n,r)=>{const i=e[t];return st(i)&&!st(n)?(i.value=n,!0):Reflect.set(e,t,n,r)}};function jN(e){return yc(e)?e:new Proxy(e,ehe)}class the{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new uI,{get:r,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=r,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function hI(e){return new the(e)}function nhe(e){const t=gt(e)?new Array(e.length):{};for(const n in e)t[n]=mY(e,n);return t}class rhe{constructor(t,n,r){this._object=t,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0,this._key=ro(n)?n:String(n),this._raw=In(t);let i=!0,o=t;if(!gt(t)||ro(this._key)||!T_(this._key))do i=!k_(o)||Ta(o);while(i&&(o=o.__v_raw));this._shallow=i}get value(){let t=this._object[this._key];return this._shallow&&(t=R(t)),this._value=t===void 0?this._defaultValue:t}set value(t){if(this._shallow&&st(this._raw[this._key])){const n=this._object[this._key];if(st(n)){n.value=t;return}}this._object[this._key]=t}get dep(){return Fde(this._raw,this._key)}}class ihe{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function XN(e,t,n){return st(e)?e:Vt(e)?new ihe(e):On(e)&&arguments.length>1?mY(e,t,n):me(e)}function mY(e,t,n){return new rhe(e,t,n)}class ohe{constructor(t,n,r){this.fn=t,this.setter=n,this._value=void 0,this.dep=new uI(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=l1-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&br!==this)return tY(this,!0),!0}get value(){const t=this.dep.track();return iY(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function ahe(e,t,n=!1){let r,i;return Vt(e)?r=e:(r=e.get,i=e.set),new ohe(r,i,n)}const she={GET:"get",HAS:"has",ITERATE:"iterate"},lhe={SET:"set",ADD:"add",DELETE:"delete",CLEAR:"clear"},gw={},SE=new WeakMap;let Rf;function uhe(){return Rf}function yY(e,t=!1,n=Rf){if(n){let r=SE.get(n);r||SE.set(n,r=[]),r.push(e)}}function che(e,t,n=gn){const{immediate:r,deep:i,once:o,scheduler:a,augmentJob:s,call:l}=n,u=w=>i?w:Ta(w)||i===!1||i===0?oc(w,1):oc(w);let c,f,h,d,p=!1,v=!1;if(st(e)?(f=()=>e.value,p=Ta(e)):yc(e)?(f=()=>u(e),p=!0):gt(e)?(v=!0,p=e.some(w=>yc(w)||Ta(w)),f=()=>e.map(w=>{if(st(w))return w.value;if(yc(w))return u(w);if(Vt(w))return l?l(w,2):w()})):Vt(e)?t?f=l?()=>l(e,2):e:f=()=>{if(h){Oc();try{h()}finally{Lc()}}const w=Rf;Rf=c;try{return l?l(e,3,[d]):e(d)}finally{Rf=w}}:f=Fi,t&&i){const w=f,x=i===!0?1/0:i;f=()=>oc(w(),x)}const y=A_(),m=()=>{c.stop(),y&&y.active&&aI(y.effects,c)};if(o&&t){const w=t;t=(...x)=>{const T=w(...x);return m(),T}}let b=v?new Array(e.length).fill(gw):gw;const S=w=>{if(!(!(c.flags&1)||!c.dirty&&!w))if(t){const x=c.run();if(w||i||p||(v?x.some((T,C)=>Ei(T,b[C])):Ei(x,b))){h&&h();const T=Rf;Rf=c;try{const C=[x,b===gw?void 0:v&&b[0]===gw?[]:b,d];b=x,l?l(t,3,C):t(...C)}finally{Rf=T}}}else c.run()};return s&&s(S),c=new s1(f),c.scheduler=a?()=>a(S,!1):S,d=w=>yY(w,!1,c),h=c.onStop=()=>{const w=SE.get(c);if(w){if(l)l(w,4);else for(const x of w)x();SE.delete(c)}},t?r?S(!0):b=c.run():a?a(S.bind(null,!0),!0):c.run(),m.pause=c.pause.bind(c),m.resume=c.resume.bind(c),m.stop=m,m}function oc(e,t=1/0,n){if(t<=0||!On(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,st(e))oc(e.value,t,n);else if(gt(e))for(let r=0;r{oc(r,t,n)});else if(x_(e)){for(const r in e)oc(e[r],t,n);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&oc(e[r],t,n)}return e}const bY=[];function fhe(e){bY.push(e)}function dhe(){bY.pop()}function hhe(e,t){}const phe={SETUP_FUNCTION:0,0:"SETUP_FUNCTION",RENDER_FUNCTION:1,1:"RENDER_FUNCTION",NATIVE_EVENT_HANDLER:5,5:"NATIVE_EVENT_HANDLER",COMPONENT_EVENT_HANDLER:6,6:"COMPONENT_EVENT_HANDLER",VNODE_HOOK:7,7:"VNODE_HOOK",DIRECTIVE_HOOK:8,8:"DIRECTIVE_HOOK",TRANSITION_HOOK:9,9:"TRANSITION_HOOK",APP_ERROR_HANDLER:10,10:"APP_ERROR_HANDLER",APP_WARN_HANDLER:11,11:"APP_WARN_HANDLER",FUNCTION_REF:12,12:"FUNCTION_REF",ASYNC_COMPONENT_LOADER:13,13:"ASYNC_COMPONENT_LOADER",SCHEDULER:14,14:"SCHEDULER",COMPONENT_UPDATE:15,15:"COMPONENT_UPDATE",APP_UNMOUNT_CLEANUP:16,16:"APP_UNMOUNT_CLEANUP"},vhe={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush",15:"component update",16:"app unmount cleanup function"};function ry(e,t,n,r){try{return r?e(...r):e()}catch(i){zp(i,t,n)}}function ts(e,t,n,r){if(Vt(e)){const i=ry(e,t,n,r);return i&&sI(i)&&i.catch(o=>{zp(o,t,n)}),i}if(gt(e)){const i=[];for(let o=0;o>>1,i=Wo[r],o=f1(i);o=f1(n)?Wo.push(e):Wo.splice(mhe(t),0,e),e.flags|=1,SY()}}function SY(){wE||(wE=_Y.then(wY))}function c1(e){gt(e)?Dg.push(...e):kf&&e.id===-1?kf.splice(Qv+1,0,e):e.flags&1||(Dg.push(e),e.flags|=1),SY()}function OB(e,t,n=jl+1){for(;nf1(n)-f1(r));if(Dg.length=0,kf){kf.push(...t);return}for(kf=t,Qv=0;Qve.id==null?e.flags&2?-1:1/0:e.id;function wY(e){try{for(jl=0;jlqv.emit(i,...o)),mw=[]):typeof window<"u"&&window.HTMLElement&&!((r=(n=window.navigator)==null?void 0:n.userAgent)!=null&&r.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(o=>{xY(o,t)}),setTimeout(()=>{qv||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,mw=[])},3e3)):mw=[]}let eo=null,pI=null;function d1(e){const t=eo;return eo=e,pI=e&&e.type.__scopeId||null,t}function yhe(e){pI=e}function bhe(){pI=null}const _he=e=>Ze;function Ze(e,t=eo,n){if(!t||e._n)return e;const r=(...i)=>{r._d&&g1(-1);const o=d1(t);let a;try{a=e(...i)}finally{d1(o),r._d&&g1(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function at(e,t){if(eo===null)return e;const n=N_(eo),r=e.dirs||(e.dirs=[]);for(let i=0;i1)return n&&Vt(t)?t.call(r&&r.proxy):t}}function ZN(){return!!(vi()||rp)}const TY=Symbol.for("v-scx"),EY=()=>Zo(TY);function vI(e,t){return P_(e,null,t)}function She(e,t){return P_(e,null,{flush:"post"})}function CY(e,t){return P_(e,null,{flush:"sync"})}function et(e,t,n){return P_(e,t,n)}function P_(e,t,n=gn){const{immediate:r,deep:i,flush:o,once:a}=n,s=pn({},n),l=t&&r||!t&&o!=="post";let u;if(wp){if(o==="sync"){const d=EY();u=d.__watcherHandles||(d.__watcherHandles=[])}else if(!l){const d=()=>{};return d.stop=Fi,d.resume=Fi,d.pause=Fi,d}}const c=Qi;s.call=(d,p,v)=>ts(d,c,p,v);let f=!1;o==="post"?s.scheduler=d=>{fi(d,c&&c.suspense)}:o!=="sync"&&(f=!0,s.scheduler=(d,p)=>{p?d():KN(d)}),s.augmentJob=d=>{t&&(d.flags|=4),f&&(d.flags|=2,c&&(d.id=c.uid,d.i=c))};const h=che(e,t,s);return wp&&(u?u.push(h):l&&h()),h}function whe(e,t,n){const r=this.proxy,i=zt(e)?e.includes(".")?IY(r,e):()=>r[e]:e.bind(r,r);let o;Vt(t)?o=t:(o=t.handler,n=t);const a=iy(this),s=P_(i,o.bind(r),n);return a(),s}function IY(e,t){const n=t.split(".");return()=>{let r=e;for(let i=0;ie.__isTeleport,Nh=e=>e&&(e.disabled||e.disabled===""),xhe=e=>e&&(e.defer||e.defer===""),LB=e=>typeof SVGElement<"u"&&e instanceof SVGElement,NB=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,ID=(e,t)=>{const n=e&&e.to;return zt(n)?t?t(n):null:n},The={name:"Teleport",__isTeleport:!0,process(e,t,n,r,i,o,a,s,l,u){const{mc:c,pc:f,pbc:h,o:{insert:d,querySelector:p,createText:v,createComment:y,parentNode:m}}=u,b=Nh(t.props);let{dynamicChildren:S}=t;const w=(C,P,k)=>{C.shapeFlag&16&&c(C.children,P,k,i,o,a,s,l)},x=(C=t)=>{const P=Nh(C.props),k=C.target=ID(C.props,p),L=AD(k,C,v,d);k&&(a!=="svg"&&LB(k)?a="svg":a!=="mathml"&&NB(k)&&(a="mathml"),i&&i.isCE&&(i.ce._teleportTargets||(i.ce._teleportTargets=new Set)).add(k),P||(w(C,k,L),K0(C,!1)))},T=C=>{const P=()=>{if(wf.get(C)===P){if(wf.delete(C),Nh(C.props)){const k=m(C.el)||n;w(C,k,C.anchor),K0(C,!0)}x(C)}};wf.set(C,P),fi(P,o)};if(e==null){const C=t.el=v(""),P=t.anchor=v("");if(d(C,n,r),d(P,n,r),xhe(t.props)||o&&o.pendingBranch){T(t);return}b&&(w(t,n,P),K0(t,!0)),x()}else{t.el=e.el;const C=t.anchor=e.anchor,P=wf.get(e);if(P){P.flags|=8,wf.delete(e),T(t);return}t.targetStart=e.targetStart;const k=t.target=e.target,L=t.targetAnchor=e.targetAnchor,O=Nh(e.props),M=O?n:k,F=O?C:L;if(a==="svg"||LB(k)?a="svg":(a==="mathml"||NB(k))&&(a="mathml"),S?(h(e.dynamicChildren,S,M,i,o,a,s),lM(e,t,!0)):l||f(e,t,M,F,i,o,a,s,!1),b)O?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):yw(t,n,C,u,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const U=t.target=ID(t.props,p);U&&yw(t,U,null,u,0)}else O&&yw(t,k,L,u,1);K0(t,b)}},remove(e,t,n,{um:r,o:{remove:i}},o){const{shapeFlag:a,children:s,anchor:l,targetStart:u,targetAnchor:c,target:f,props:h}=e,d=o||!Nh(h),p=wf.get(e);if(p&&(p.flags|=8,wf.delete(e)),f&&(i(u),i(c)),o&&i(l),!p&&a&16)for(let v=0;v{e.isMounted=!0}),L_(()=>{e.isUnmounting=!0}),e}const hs=[Function,Array],qN={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:hs,onEnter:hs,onAfterEnter:hs,onEnterCancelled:hs,onBeforeLeave:hs,onLeave:hs,onAfterLeave:hs,onLeaveCancelled:hs,onBeforeAppear:hs,onAppear:hs,onAfterAppear:hs,onAppearCancelled:hs},kY=e=>{const t=e.subTree;return t.component?kY(t.component):t},Che={name:"BaseTransition",props:qN,setup(e,{slots:t}){const n=vi(),r=QN();return()=>{const i=t.default&&gI(t.default(),!0),o=i&&i.length?PY(i):n.subTree?Fe():void 0;if(!o)return;const a=In(e),{mode:s}=a;if(r.isLeaving)return SR(o);const l=MB(o);if(!l)return SR(o);let u=im(l,a,r,n,f=>u=f);l.type!==ii&&Nc(l,u);let c=n.subTree&&MB(n.subTree);if(c&&c.type!==ii&&!sl(c,l)&&kY(n).type!==ii){let f=im(c,a,r,n);if(Nc(c,f),s==="out-in"&&l.type!==ii)return r.isLeaving=!0,f.afterLeave=()=>{r.isLeaving=!1,n.job.flags&8||n.update(),delete f.afterLeave,c=void 0},SR(o);s==="in-out"&&l.type!==ii?f.delayLeave=(h,d,p)=>{const v=OY(r,c);v[String(c.key)]=c,h[Ss]=()=>{d(),h[Ss]=void 0,delete u.delayedLeave,c=void 0},u.delayedLeave=()=>{p(),delete u.delayedLeave,c=void 0}}:c=void 0}else c&&(c=void 0);return o}}};function PY(e){let t=e[0];if(e.length>1){for(const n of e)if(n.type!==ii){t=n;break}}return t}const DY=Che;function OY(e,t){const{leavingVNodes:n}=e;let r=n.get(t.type);return r||(r=Object.create(null),n.set(t.type,r)),r}function im(e,t,n,r,i){const{appear:o,mode:a,persisted:s=!1,onBeforeEnter:l,onEnter:u,onAfterEnter:c,onEnterCancelled:f,onBeforeLeave:h,onLeave:d,onAfterLeave:p,onLeaveCancelled:v,onBeforeAppear:y,onAppear:m,onAfterAppear:b,onAppearCancelled:S}=t,w=String(e.key),x=OY(n,e),T=(k,L)=>{k&&ts(k,r,9,L)},C=(k,L)=>{const O=L[1];T(k,L),gt(k)?k.every(M=>M.length<=1)&&O():k.length<=1&&O()},P={mode:a,persisted:s,beforeEnter(k){let L=l;if(!n.isMounted)if(o)L=y||l;else return;k[Ss]&&k[Ss](!0);const O=x[w];O&&sl(e,O)&&O.el[Ss]&&O.el[Ss](),T(L,[k])},enter(k){if(x[w]===e)return;let L=u,O=c,M=f;if(!n.isMounted)if(o)L=m||u,O=b||c,M=S||f;else return;let F=!1;k[t0]=X=>{F||(F=!0,X?T(M,[k]):T(O,[k]),P.delayedLeave&&P.delayedLeave(),k[t0]=void 0)};const U=k[t0].bind(null,!1);L?C(L,[k,U]):U()},leave(k,L){const O=String(e.key);if(k[t0]&&k[t0](!0),n.isUnmounting)return L();T(h,[k]);let M=!1;k[Ss]=U=>{M||(M=!0,L(),U?T(v,[k]):T(p,[k]),k[Ss]=void 0,x[O]===e&&delete x[O])};const F=k[Ss].bind(null,!1);x[O]=e,d?C(d,[k,F]):F()},clone(k){const L=im(k,t,n,r,i);return i&&i(L),L}};return P}function SR(e){if(D_(e))return e=Su(e),e.children=null,e}function MB(e){if(!D_(e))return RY(e.type)&&e.children?PY(e.children):e;if(e.component)return e.component.subTree;const{shapeFlag:t,children:n}=e;if(n){if(t&16)return n[0];if(t&32&&Vt(n.default))return n.default()}}function Nc(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Nc(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function gI(e,t=!1,n){let r=[],i=0;for(let o=0;o1)for(let o=0;on.value,set:o=>n.value=o})}return n}function FB(e,t){let n;return!!((n=Object.getOwnPropertyDescriptor(e,t))&&!n.configurable)}const TE=new WeakMap;function Lg(e,t,n,r,i=!1){if(gt(e)){e.forEach((v,y)=>Lg(v,t&&(gt(t)?t[y]:t),n,r,i));return}if(bc(r)&&!i){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&Lg(e,t,n,r.component.subTree);return}const o=r.shapeFlag&4?N_(r.component):r.el,a=i?null:o,{i:s,r:l}=e,u=t&&t.r,c=s.refs===gn?s.refs={}:s.refs,f=s.setupState,h=In(f),d=f===gn?$h:v=>FB(c,v)?!1:Mn(h,v),p=(v,y)=>!(y&&FB(c,y));if(u!=null&&u!==l){if($B(t),zt(u))c[u]=null,d(u)&&(f[u]=null);else if(st(u)){const v=t;p(u,v.k)&&(u.value=null),v.k&&(c[v.k]=null)}}if(Vt(l))ry(l,s,12,[a,c]);else{const v=zt(l),y=st(l);if(v||y){const m=()=>{if(e.f){const b=v?d(l)?f[l]:c[l]:p()||!e.k?l.value:c[e.k];if(i)gt(b)&&aI(b,o);else if(gt(b))b.includes(o)||b.push(o);else if(v)c[l]=[o],d(l)&&(f[l]=c[l]);else{const S=[o];p(l,e.k)&&(l.value=S),e.k&&(c[e.k]=S)}}else v?(c[l]=a,d(l)&&(f[l]=a)):y&&(p(l,e.k)&&(l.value=a),e.k&&(c[e.k]=a))};if(a){const b=()=>{m(),TE.delete(e)};b.id=-1,TE.set(e,b),fi(b,n)}else $B(e),m()}}}function $B(e){const t=TE.get(e);t&&(t.flags|=8,TE.delete(e))}let BB=!1;const Ev=()=>{BB||(console.error("Hydration completed but contains mismatches."),BB=!0)},Rhe=e=>e.namespaceURI.includes("svg")&&e.tagName!=="foreignObject",khe=e=>e.namespaceURI.includes("MathML"),bw=e=>{if(e.nodeType===1){if(Rhe(e))return"svg";if(khe(e))return"mathml"}},dg=e=>e.nodeType===8;function Phe(e){const{mt:t,p:n,o:{patchProp:r,createText:i,nextSibling:o,parentNode:a,remove:s,insert:l,createComment:u}}=e,c=(S,w)=>{if(!w.hasChildNodes()){n(null,S,w),xE(),w._vnode=S;return}f(w.firstChild,S,null,null,null),xE(),w._vnode=S},f=(S,w,x,T,C,P=!1)=>{P=P||!!w.dynamicChildren;const k=dg(S)&&S.data==="[",L=()=>v(S,w,x,T,C,k),{type:O,ref:M,shapeFlag:F,patchFlag:U}=w;let X=S.nodeType;w.el=S,U===-2&&(P=!1,w.dynamicChildren=null);let $=null;switch(O){case _c:X!==3?w.children===""?(l(w.el=i(""),a(S),S),$=S):$=L():(S.data!==w.children&&(Ev(),S.data=w.children),$=o(S));break;case ii:b(S)?($=o(S),m(w.el=S.content.firstChild,S,x)):X!==8||k?$=L():$=o(S);break;case ip:if(k&&(S=o(S),X=S.nodeType),X===1||X===3){$=S;const W=!w.children.length;for(let G=0;G{P=P||!!w.dynamicChildren;const{type:k,props:L,patchFlag:O,shapeFlag:M,dirs:F,transition:U}=w,X=k==="input"||k==="option";if(X||O!==-1){F&&Kl(w,null,x,"created");let $=!1;if(b(S)){$=aj(null,U)&&x&&x.vnode.props&&x.vnode.props.appear;const G=S.content.firstChild;if($){const Q=G.getAttribute("class");Q&&(G.$cls=Q),U.beforeEnter(G)}m(G,S,x),w.el=S=G}if(M&16&&!(L&&(L.innerHTML||L.textContent))){let G=d(S.firstChild,w,S,x,T,C,P);for(G&&!_w(S,1)&&Ev();G;){const Q=G;G=G.nextSibling,s(Q)}}else if(M&8){let G=w.children;G[0]===` +`&&(S.tagName==="PRE"||S.tagName==="TEXTAREA")&&(G=G.slice(1));const{textContent:Q}=S;Q!==G&&Q!==G.replace(/\r\n|\r/g,` +`)&&(_w(S,0)||Ev(),S.textContent=w.children)}if(L){if(X||!P||O&48){const G=S.tagName.includes("-");for(const Q in L)(X&&(Q.endsWith("value")||Q==="indeterminate")||_d(Q)&&!lu(Q)||Q[0]==="."||G&&!lu(Q))&&r(S,Q,null,L[Q],void 0,x)}else if(L.onClick)r(S,"onClick",null,L.onClick,void 0,x);else if(O&4&&yc(L.style))for(const G in L.style)L.style[G]}let W;(W=L&&L.onVnodeBeforeMount)&&pa(W,x,w),F&&Kl(w,null,x,"beforeMount"),((W=L&&L.onVnodeMounted)||F||$)&&cj(()=>{W&&pa(W,x,w),$&&U.enter(S),F&&Kl(w,null,x,"mounted")},T)}return S.nextSibling},d=(S,w,x,T,C,P,k)=>{k=k||!!w.dynamicChildren;const L=w.children,O=L.length;let M=!1;for(let F=0;F{const{slotScopeIds:k}=w;k&&(C=C?C.concat(k):k);const L=a(S),O=d(o(S),w,L,x,T,C,P);return O&&dg(O)&&O.data==="]"?o(w.anchor=O):(Ev(),l(w.anchor=u("]"),L,O),O)},v=(S,w,x,T,C,P)=>{if(_w(S.parentElement,1)||Ev(),w.el=null,P){const O=y(S);for(;;){const M=o(S);if(M&&M!==O)s(M);else break}}const k=o(S),L=a(S);return s(S),n(null,w,L,k,x,T,bw(L),C),x&&(x.vnode.el=w.el,bI(x,w.el)),k},y=(S,w="[",x="]")=>{let T=0;for(;S;)if(S=o(S),S&&dg(S)&&(S.data===w&&T++,S.data===x)){if(T===0)return o(S);T--}return S},m=(S,w,x)=>{const T=w.parentNode;T&&T.replaceChild(S,w);let C=x;for(;C;)C.vnode.el===w&&(C.vnode.el=C.subTree.el=S),C=C.parent},b=S=>S.nodeType===1&&S.tagName==="TEMPLATE";return[c,f]}const VB="data-allow-mismatch",Dhe={0:"text",1:"children",2:"class",3:"style",4:"attribute"};function _w(e,t){if(t===0||t===1)for(;e&&!e.hasAttribute(VB);)e=e.parentElement;const n=e&&e.getAttribute(VB);if(n==null)return!1;if(n==="")return!0;{const r=n.split(",");return t===0&&r.includes("children")?!0:r.includes(Dhe[t])}}const Ohe=C_().requestIdleCallback||(e=>setTimeout(e,1)),Lhe=C_().cancelIdleCallback||(e=>clearTimeout(e)),Nhe=(e=1e4)=>t=>{const n=Ohe(t,{timeout:e});return()=>Lhe(n)};function Mhe(e){const{top:t,left:n,bottom:r,right:i}=e.getBoundingClientRect(),{innerHeight:o,innerWidth:a}=window;return(t>0&&t0&&r0&&n0&&i(t,n)=>{const r=new IntersectionObserver(i=>{for(const o of i)if(o.isIntersecting){r.disconnect(),t();break}},e);return n(i=>{if(i instanceof Element){if(Mhe(i))return t(),r.disconnect(),!1;r.observe(i)}}),()=>r.disconnect()},$he=e=>t=>{if(e){const n=matchMedia(e);if(n.matches)t();else return n.addEventListener("change",t,{once:!0}),()=>n.removeEventListener("change",t)}},Bhe=(e=[])=>(t,n)=>{zt(e)&&(e=[e]);let r=!1;const i=a=>{r||(r=!0,o(),t(),a.target.dispatchEvent(new a.constructor(a.type,a)))},o=()=>{n(a=>{for(const s of e)a.removeEventListener(s,i)})};return n(a=>{for(const s of e)a.addEventListener(s,i,{once:!0})}),o};function Vhe(e,t){if(dg(e)&&e.data==="["){let n=1,r=e.nextSibling;for(;r;){if(r.nodeType===1){if(t(r)===!1)break}else if(dg(r))if(r.data==="]"){if(--n===0)break}else r.data==="["&&n++;r=r.nextSibling}}else t(e)}const bc=e=>!!e.type.__asyncLoader;function Uhe(e){Vt(e)&&(e={loader:e});const{loader:t,loadingComponent:n,errorComponent:r,delay:i=200,hydrate:o,timeout:a,suspensible:s=!0,onError:l}=e;let u=null,c,f=0;const h=()=>(f++,u=null,d()),d=()=>{let p;return u||(p=u=t().catch(v=>{if(v=v instanceof Error?v:new Error(String(v)),l)return new Promise((y,m)=>{l(v,()=>y(h()),()=>m(v),f+1)});throw v}).then(v=>p!==u&&u?u:(v&&(v.__esModule||v[Symbol.toStringTag]==="Module")&&(v=v.default),c=v,v)))};return Ye({name:"AsyncComponentWrapper",__asyncLoader:d,__asyncHydrate(p,v,y){let m=!1;(v.bu||(v.bu=[])).push(()=>m=!0);const b=()=>{m||y()},S=o?()=>{const w=o(b,x=>Vhe(p,x));w&&(v.bum||(v.bum=[])).push(w)}:b;c?S():d().then(()=>!v.isUnmounted&&S())},get __asyncResolved(){return c},setup(){const p=Qi;if(eM(p),c)return()=>Sw(c,p);const v=x=>{u=null,zp(x,p,13,!r)};if(s&&p.suspense||wp)return d().then(x=>()=>Sw(x,p)).catch(x=>(v(x),()=>r?B(r,{error:x}):null));const y=me(!1),m=me(),b=me(!!i);let S,w;return Do(()=>{S!=null&&clearTimeout(S),w!=null&&clearTimeout(w)}),i&&(w=setTimeout(()=>{p.isUnmounted||(b.value=!1)},i)),a!=null&&(S=setTimeout(()=>{if(!p.isUnmounted&&!y.value&&!m.value){const x=new Error(`Async component timed out after ${a}ms.`);v(x),m.value=x}},a)),d().then(()=>{p.isUnmounted||(y.value=!0,p.parent&&D_(p.parent.vnode)&&p.parent.update())}).catch(x=>{if(p.isUnmounted){u=null;return}v(x),m.value=x}),()=>{if(y.value&&c)return Sw(c,p);if(m.value&&r)return B(r,{error:m.value});if(n&&!b.value)return Sw(n,p)}}})}function Sw(e,t){const{ref:n,props:r,children:i,ce:o}=t.vnode,a=B(e,r,i);return a.ref=n,a.ce=o,delete t.vnode.ce,a}const D_=e=>e.type.__isKeepAlive,Ghe={name:"KeepAlive",__isKeepAlive:!0,props:{include:[String,RegExp,Array],exclude:[String,RegExp,Array],max:[String,Number]},setup(e,{slots:t}){const n=vi(),r=n.ctx;if(!r.renderer)return()=>{const b=t.default&&t.default();return b&&b.length===1?b[0]:b};const i=new Map,o=new Set;let a=null;const s=n.suspense,{renderer:{p:l,m:u,um:c,o:{createElement:f}}}=r,h=f("div");r.activate=(b,S,w,x,T)=>{const C=b.component;u(b,S,w,0,s),l(C.vnode,b,S,w,C,s,x,b.slotScopeIds,T),fi(()=>{C.isDeactivated=!1,C.a&&tp(C.a);const P=b.props&&b.props.onVnodeMounted;P&&pa(P,C.parent,b)},s)},r.deactivate=b=>{const S=b.component;CE(S.m),CE(S.a),u(b,h,null,1,s),fi(()=>{S.da&&tp(S.da);const w=b.props&&b.props.onVnodeUnmounted;w&&pa(w,S.parent,b),S.isDeactivated=!0},s)};function d(b){wR(b),c(b,n,s,!0)}function p(b){i.forEach((S,w)=>{const x=FD(bc(S)?S.type.__asyncResolved||{}:S.type);x&&!b(x)&&v(w)})}function v(b){const S=i.get(b);S&&(!a||!sl(S,a))?d(S):a&&wR(a),i.delete(b),o.delete(b)}et(()=>[e.include,e.exclude],([b,S])=>{b&&p(w=>Z0(b,w)),S&&p(w=>!Z0(S,w))},{flush:"post",deep:!0});let y=null;const m=()=>{y!=null&&(IE(n.subTree.type)?fi(()=>{i.set(y,ww(n.subTree))},n.subTree.suspense):i.set(y,ww(n.subTree)))};return Sr(m),O_(m),L_(()=>{i.forEach(b=>{const{subTree:S,suspense:w}=n,x=ww(S);if(b.type===x.type&&b.key===x.key){wR(x);const T=x.component.da;T&&fi(T,w);return}d(b)})}),()=>{if(y=null,!t.default)return a=null;const b=t.default(),S=b[0];if(b.length>1)return a=null,b;if(!ns(S)||!(S.shapeFlag&4)&&!(S.shapeFlag&128))return a=null,S;let w=ww(S);if(w.type===ii)return a=null,w;const x=w.type,T=FD(bc(w)?w.type.__asyncResolved||{}:x),{include:C,exclude:P,max:k}=e;if(C&&(!T||!Z0(C,T))||P&&T&&Z0(P,T))return w.shapeFlag&=-257,a=w,S;const L=w.key==null?x:w.key,O=i.get(L);return w.el&&(w=Su(w),S.shapeFlag&128&&(S.ssContent=w)),y=L,O?(w.el=O.el,w.component=O.component,w.transition&&Nc(w,w.transition),w.shapeFlag|=512,o.delete(L),o.add(L)):(o.add(L),k&&o.size>parseInt(k,10)&&v(o.values().next().value)),w.shapeFlag|=256,a=w,IE(S.type)?S:w}}},Hhe=Ghe;function Z0(e,t){return gt(e)?e.some(n=>Z0(n,t)):zt(e)?e.split(",").includes(t):$7(e)?(e.lastIndex=0,e.test(t)):!1}function LY(e,t){MY(e,"a",t)}function NY(e,t){MY(e,"da",t)}function MY(e,t,n=Qi){const r=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(mI(t,r,n),n){let i=n.parent;for(;i&&i.parent;)D_(i.parent.vnode)&&Whe(r,t,n,i),i=i.parent}}function Whe(e,t,n,r){const i=mI(t,e,r,!0);Do(()=>{aI(r[t],i)},n)}function wR(e){e.shapeFlag&=-257,e.shapeFlag&=-513}function ww(e){return e.shapeFlag&128?e.ssContent:e}function mI(e,t,n=Qi,r=!1){if(n){const i=n[e]||(n[e]=[]),o=t.__weh||(t.__weh=(...a)=>{Oc();const s=iy(n),l=ts(t,n,e,a);return s(),Lc(),l});return r?i.unshift(o):i.push(o),o}}const zc=e=>(t,n=Qi)=>{(!wp||e==="sp")&&mI(e,(...r)=>t(...r),n)},FY=zc("bm"),Sr=zc("m"),tM=zc("bu"),O_=zc("u"),L_=zc("bum"),Do=zc("um"),$Y=zc("sp"),BY=zc("rtg"),VY=zc("rtc");function UY(e,t=Qi){mI("ec",e,t)}const nM="components",zhe="directives";function Yhe(e,t){return rM(nM,e,!0,t)||e}const GY=Symbol.for("v-ndc");function Fr(e){return zt(e)?rM(nM,e,!1)||e:e||GY}function jhe(e){return rM(zhe,e)}function rM(e,t,n=!0,r=!1){const i=eo||Qi;if(i){const o=i.type;if(e===nM){const s=FD(o,!1);if(s&&(s===t||s===ir(t)||s===wd(ir(t))))return o}const a=UB(i[e]||o[e],t)||UB(i.appContext[e],t);return!a&&r?o:a}}function UB(e,t){return e&&(e[t]||e[ir(t)]||e[wd(ir(t))])}function Ct(e,t,n,r){let i;const o=n&&n[r],a=gt(e);if(a||zt(e)){const s=a&&yc(e);let l=!1,u=!1;s&&(l=!Ta(e),u=_u(e),e=cI(e)),i=new Array(e.length);for(let c=0,f=e.length;ct(s,l,void 0,o&&o[l]));else{const s=Object.keys(e);i=new Array(s.length);for(let l=0,u=s.length;l{const o=r.fn(...i);return o&&(o.key=r.key),o}:r.fn)}return e}function Ea(e,t,n={},r,i){if(eo.ce||eo.parent&&bc(eo.parent)&&eo.parent.ce){const u=Object.keys(n).length>0;return t!=="default"&&(n.name=t),V(),qe($e,null,[B("slot",n,r&&r())],u?-2:64)}let o=e[t];o&&o._c&&(o._d=!1),V();const a=o&&iM(o(n)),s=n.key||a&&a.key,l=qe($e,{key:(s&&!ro(s)?s:`_${t}`)+(!a&&r?"_fb":"")},a||(r?r():[]),a&&e._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),o&&o._c&&(o._d=!0),l}function iM(e){return e.some(t=>ns(t)?!(t.type===ii||t.type===$e&&!iM(t.children)):!0)?e:null}function Khe(e,t){const n={};for(const r in e)n[t&&/[A-Z]/.test(r)?`on:${r}`:ep(r)]=e[r];return n}const RD=e=>e?mj(e)?N_(e):RD(e.parent):null,_b=pn(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>RD(e.parent),$root:e=>RD(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>oM(e),$forceUpdate:e=>e.f||(e.f=()=>{KN(e.update)}),$nextTick:e=>e.n||(e.n=Tr.bind(e.proxy)),$watch:e=>whe.bind(e)}),xR=(e,t)=>e!==gn&&!e.__isScriptSetup&&Mn(e,t),kD={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:r,data:i,props:o,accessCache:a,type:s,appContext:l}=e;if(t[0]!=="$"){const h=a[t];if(h!==void 0)switch(h){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return o[t]}else{if(xR(r,t))return a[t]=1,r[t];if(i!==gn&&Mn(i,t))return a[t]=2,i[t];if(Mn(o,t))return a[t]=3,o[t];if(n!==gn&&Mn(n,t))return a[t]=4,n[t];PD&&(a[t]=0)}}const u=_b[t];let c,f;if(u)return t==="$attrs"&&_o(e.attrs,"get",""),u(e);if((c=s.__cssModules)&&(c=c[t]))return c;if(n!==gn&&Mn(n,t))return a[t]=4,n[t];if(f=l.config.globalProperties,Mn(f,t))return f[t]},set({_:e},t,n){const{data:r,setupState:i,ctx:o}=e;return xR(i,t)?(i[t]=n,!0):r!==gn&&Mn(r,t)?(r[t]=n,!0):Mn(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(o[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,props:o,type:a}},s){let l;return!!(n[s]||e!==gn&&s[0]!=="$"&&Mn(e,s)||xR(t,s)||Mn(o,s)||Mn(r,s)||Mn(_b,s)||Mn(i.config.globalProperties,s)||(l=a.__cssModules)&&l[s])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Mn(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}},Zhe=pn({},kD,{get(e,t){if(t!==Symbol.unscopables)return kD.get(e,t,e)},has(e,t){return t[0]!=="_"&&!BN(t)}});function Jhe(){return null}function Qhe(){return null}function qhe(e){}function epe(e){}function tpe(){return null}function npe(){}function rpe(e,t){return null}function ipe(){return HY().slots}function ope(){return HY().attrs}function HY(e){const t=vi();return t.setupContext||(t.setupContext=_j(t))}function h1(e){return gt(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function ape(e,t){const n=h1(e);for(const r in t){if(r.startsWith("__skip"))continue;let i=n[r];i?gt(i)||Vt(i)?i=n[r]={type:i,default:t[r]}:i.default=t[r]:i===null&&(i=n[r]={default:t[r]}),i&&t[`__skip_${r}`]&&(i.skipFactory=!0)}return n}function p1(e,t){return!e||!t?e||t:gt(e)&>(t)?e.concat(t):pn({},h1(e),h1(t))}function spe(e,t){const n={};for(const r in e)t.includes(r)||Object.defineProperty(n,r,{enumerable:!0,get:()=>e[r]});return n}function lpe(e){const t=vi(),n=wp;let r=e();m1(),n&&Mg(!1);const i=()=>{iy(t),n&&Mg(!0)},o=()=>{vi()!==t&&t.scope.off(),m1(),n&&Mg(!1)};return sI(r)&&(r=r.catch(a=>{throw i(),Promise.resolve().then(()=>Promise.resolve().then(o)),a})),[r,()=>{i(),Promise.resolve().then(o)}]}let PD=!0;function upe(e){const t=oM(e),n=e.proxy,r=e.ctx;PD=!1,t.beforeCreate&&GB(t.beforeCreate,e,"bc");const{data:i,computed:o,methods:a,watch:s,provide:l,inject:u,created:c,beforeMount:f,mounted:h,beforeUpdate:d,updated:p,activated:v,deactivated:y,beforeDestroy:m,beforeUnmount:b,destroyed:S,unmounted:w,render:x,renderTracked:T,renderTriggered:C,errorCaptured:P,serverPrefetch:k,expose:L,inheritAttrs:O,components:M,directives:F,filters:U}=t;if(u&&cpe(u,r,null),a)for(const W in a){const G=a[W];Vt(G)&&(r[W]=G.bind(n))}if(i){const W=i.call(n,n);On(W)&&(e.data=io(W))}if(PD=!0,o)for(const W in o){const G=o[W],Q=Vt(G)?G.bind(n,n):Vt(G.get)?G.get.bind(n,n):Fi,ne=!Vt(G)&&Vt(G.set)?G.set.bind(n):Fi,re=ae({get:Q,set:ne});Object.defineProperty(r,W,{enumerable:!0,configurable:!0,get:()=>re.value,set:pe=>re.value=pe})}if(s)for(const W in s)WY(s[W],r,n,W);if(l){const W=Vt(l)?l.call(n):l;Reflect.ownKeys(W).forEach(G=>{Og(G,W[G])})}c&&GB(c,e,"c");function $(W,G){gt(G)?G.forEach(Q=>W(Q.bind(n))):G&&W(G.bind(n))}if($(FY,f),$(Sr,h),$(tM,d),$(O_,p),$(LY,v),$(NY,y),$(UY,P),$(VY,T),$(BY,C),$(L_,b),$(Do,w),$($Y,k),gt(L))if(L.length){const W=e.exposed||(e.exposed={});L.forEach(G=>{Object.defineProperty(W,G,{get:()=>n[G],set:Q=>n[G]=Q,enumerable:!0})})}else e.exposed||(e.exposed={});x&&e.render===Fi&&(e.render=x),O!=null&&(e.inheritAttrs=O),M&&(e.components=M),F&&(e.directives=F),k&&eM(e)}function cpe(e,t,n=Fi){gt(e)&&(e=DD(e));for(const r in e){const i=e[r];let o;On(i)?"default"in i?o=Zo(i.from||r,i.default,!0):o=Zo(i.from||r):o=Zo(i),st(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:a=>o.value=a}):t[r]=o}}function GB(e,t,n){ts(gt(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,n)}function WY(e,t,n,r){let i=r.includes(".")?IY(n,r):()=>n[r];if(zt(e)){const o=t[e];Vt(o)&&et(i,o)}else if(Vt(e))et(i,e.bind(n));else if(On(e))if(gt(e))e.forEach(o=>WY(o,t,n,r));else{const o=Vt(e.handler)?e.handler.bind(n):t[e.handler];Vt(o)&&et(i,o,e)}}function oM(e){const t=e.type,{mixins:n,extends:r}=t,{mixins:i,optionsCache:o,config:{optionMergeStrategies:a}}=e.appContext,s=o.get(t);let l;return s?l=s:!i.length&&!n&&!r?l=t:(l={},i.length&&i.forEach(u=>EE(l,u,a,!0)),EE(l,t,a)),On(t)&&o.set(t,l),l}function EE(e,t,n,r=!1){const{mixins:i,extends:o}=t;o&&EE(e,o,n,!0),i&&i.forEach(a=>EE(e,a,n,!0));for(const a in t)if(!(r&&a==="expose")){const s=fpe[a]||n&&n[a];e[a]=s?s(e[a],t[a]):t[a]}return e}const fpe={data:HB,props:WB,emits:WB,methods:J0,computed:J0,beforeCreate:Mo,created:Mo,beforeMount:Mo,mounted:Mo,beforeUpdate:Mo,updated:Mo,beforeDestroy:Mo,beforeUnmount:Mo,destroyed:Mo,unmounted:Mo,activated:Mo,deactivated:Mo,errorCaptured:Mo,serverPrefetch:Mo,components:J0,directives:J0,watch:hpe,provide:HB,inject:dpe};function HB(e,t){return t?e?function(){return pn(Vt(e)?e.call(this,this):e,Vt(t)?t.call(this,this):t)}:t:e}function dpe(e,t){return J0(DD(e),DD(t))}function DD(e){if(gt(e)){const t={};for(let n=0;n{let c,f=gn,h;return CY(()=>{const d=e[i];Ei(c,d)&&(c=d,u())}),{get(){return l(),n.get?n.get(c):c},set(d){const p=n.set?n.set(d):d;if(!Ei(p,c)&&!(f!==gn&&Ei(d,f)))return;const v=r.vnode.props,y=!!(v&&(t in v||i in v||o in v)&&(`onUpdate:${t}`in v||`onUpdate:${i}`in v||`onUpdate:${o}`in v));y||(c=d,u()),r.emit(`update:${t}`,p),Ei(d,f)&&(Ei(d,p)&&!Ei(p,h)||y&&f!==gn&&!Ei(p,c))&&u(),f=d,h=p}}});return s[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?a||gn:s,done:!1}:{done:!0}}}},s}const YY=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${ir(t)}Modifiers`]||e[`${wo(t)}Modifiers`];function gpe(e,t,...n){if(e.isUnmounted)return;const r=e.vnode.props||gn;let i=n;const o=t.startsWith("update:"),a=o&&YY(r,t.slice(7));a&&(a.trim&&(i=n.map(c=>zt(c)?c.trim():c)),a.number&&(i=n.map(E_)));let s,l=r[s=ep(t)]||r[s=ep(ir(t))];!l&&o&&(l=r[s=ep(wo(t))]),l&&ts(l,e,6,i);const u=r[s+"Once"];if(u){if(!e.emitted)e.emitted={};else if(e.emitted[s])return;e.emitted[s]=!0,ts(u,e,6,i)}}const mpe=new WeakMap;function jY(e,t,n=!1){const r=n?mpe:t.emitsCache,i=r.get(e);if(i!==void 0)return i;const o=e.emits;let a={},s=!1;if(!Vt(e)){const l=u=>{const c=jY(u,t,!0);c&&(s=!0,pn(a,c))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!o&&!s?(On(e)&&r.set(e,null),null):(gt(o)?o.forEach(l=>a[l]=null):pn(a,o),On(e)&&r.set(e,a),a)}function yI(e,t){return!e||!_d(t)?!1:(t=t.slice(2).replace(/Once$/,""),Mn(e,t[0].toLowerCase()+t.slice(1))||Mn(e,wo(t))||Mn(e,t))}function Jx(e){const{type:t,vnode:n,proxy:r,withProxy:i,propsOptions:[o],slots:a,attrs:s,emit:l,render:u,renderCache:c,props:f,data:h,setupState:d,ctx:p,inheritAttrs:v}=e,y=d1(e);let m,b;try{if(n.shapeFlag&4){const w=i||r,x=w;m=ga(u.call(x,w,c,f,d,h,p)),b=s}else{const w=t;m=ga(w.length>1?w(f,{attrs:s,slots:a,emit:l}):w(f,null)),b=t.props?s:bpe(s)}}catch(w){Sb.length=0,zp(w,e,1),m=B(ii)}let S=m;if(b&&v!==!1){const w=Object.keys(b),{shapeFlag:x}=S;w.length&&x&7&&(o&&w.some(w_)&&(b=_pe(b,o)),S=Su(S,b,!1,!0))}return n.dirs&&(S=Su(S,null,!1,!0),S.dirs=S.dirs?S.dirs.concat(n.dirs):n.dirs),n.transition&&Nc(S,n.transition),m=S,d1(y),m}function ype(e,t=!0){let n;for(let r=0;r{let t;for(const n in e)(n==="class"||n==="style"||_d(n))&&((t||(t={}))[n]=e[n]);return t},_pe=(e,t)=>{const n={};for(const r in e)(!w_(r)||!(r.slice(9)in t))&&(n[r]=e[r]);return n};function Spe(e,t,n){const{props:r,children:i,component:o}=e,{props:a,children:s,patchFlag:l}=t,u=o.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return r?zB(r,a,u):!!a;if(l&8){const c=t.dynamicProps;for(let f=0;fObject.create(KY),JY=e=>Object.getPrototypeOf(e)===KY;function wpe(e,t,n,r=!1){const i={},o=ZY();e.propsDefaults=Object.create(null),QY(e,t,i,o);for(const a in e.propsOptions[0])a in i||(i[a]=void 0);n?e.props=r?i:YN(i):e.type.props?e.props=i:e.props=o,e.attrs=o}function xpe(e,t,n,r){const{props:i,attrs:o,vnode:{patchFlag:a}}=e,s=In(i),[l]=e.propsOptions;let u=!1;if((r||a>0)&&!(a&16)){if(a&8){const c=e.vnode.dynamicProps;for(let f=0;f{l=!0;const[h,d]=qY(f,t,!0);pn(a,h),d&&s.push(...d)};!n&&t.mixins.length&&t.mixins.forEach(c),e.extends&&c(e.extends),e.mixins&&e.mixins.forEach(c)}if(!o&&!l)return On(e)&&r.set(e,Qh),Qh;if(gt(o))for(let c=0;ce==="_"||e==="_ctx"||e==="$stable",sM=e=>gt(e)?e.map(ga):[ga(e)],Epe=(e,t,n)=>{if(t._n)return t;const r=Ze((...i)=>sM(t(...i)),n);return r._c=!1,r},ej=(e,t,n)=>{const r=e._ctx;for(const i in e){if(aM(i))continue;const o=e[i];if(Vt(o))t[i]=Epe(i,o,r);else if(o!=null){const a=sM(o);t[i]=()=>a}}},tj=(e,t)=>{const n=sM(t);e.slots.default=()=>n},nj=(e,t,n)=>{for(const r in t)(n||!aM(r))&&(e[r]=t[r])},Cpe=(e,t,n)=>{const r=e.slots=ZY();if(e.vnode.shapeFlag&32){const i=t._;i?(nj(r,t,n),n&&$N(r,"_",i,!0)):ej(t,r)}else t&&tj(e,t)},Ipe=(e,t,n)=>{const{vnode:r,slots:i}=e;let o=!0,a=gn;if(r.shapeFlag&32){const s=t._;s?n&&s===1?o=!1:nj(i,t,n):(o=!t.$stable,ej(t,i)),a=t}else t&&(tj(e,t),a={default:1});if(o)for(const s in i)!aM(s)&&a[s]==null&&delete i[s]},fi=cj;function rj(e){return oj(e)}function ij(e){return oj(e,Phe)}function oj(e,t){const n=C_();n.__VUE__=!0;const{insert:r,remove:i,patchProp:o,createElement:a,createText:s,createComment:l,setText:u,setElementText:c,parentNode:f,nextSibling:h,setScopeId:d=Fi,insertStaticContent:p}=e,v=(J,ie,ge,Te=null,Oe=null,Z=null,oe=void 0,ve=null,xe=!!ie.dynamicChildren)=>{if(J===ie)return;J&&!sl(J,ie)&&(Te=fe(J),pe(J,Oe,Z,!0),J=null),ie.patchFlag===-2&&(xe=!1,ie.dynamicChildren=null);const{type:Pe,ref:ze,shapeFlag:de}=ie;switch(Pe){case _c:y(J,ie,ge,Te);break;case ii:m(J,ie,ge,Te);break;case ip:J==null&&b(ie,ge,Te,oe);break;case $e:M(J,ie,ge,Te,Oe,Z,oe,ve,xe);break;default:de&1?x(J,ie,ge,Te,Oe,Z,oe,ve,xe):de&6?F(J,ie,ge,Te,Oe,Z,oe,ve,xe):(de&64||de&128)&&Pe.process(J,ie,ge,Te,Oe,Z,oe,ve,xe,Ue)}ze!=null&&Oe?Lg(ze,J&&J.ref,Z,ie||J,!ie):ze==null&&J&&J.ref!=null&&Lg(J.ref,null,Z,J,!0)},y=(J,ie,ge,Te)=>{if(J==null)r(ie.el=s(ie.children),ge,Te);else{const Oe=ie.el=J.el;ie.children!==J.children&&u(Oe,ie.children)}},m=(J,ie,ge,Te)=>{J==null?r(ie.el=l(ie.children||""),ge,Te):ie.el=J.el},b=(J,ie,ge,Te)=>{[J.el,J.anchor]=p(J.children,ie,ge,Te,J.el,J.anchor)},S=({el:J,anchor:ie},ge,Te)=>{let Oe;for(;J&&J!==ie;)Oe=h(J),r(J,ge,Te),J=Oe;r(ie,ge,Te)},w=({el:J,anchor:ie})=>{let ge;for(;J&&J!==ie;)ge=h(J),i(J),J=ge;i(ie)},x=(J,ie,ge,Te,Oe,Z,oe,ve,xe)=>{if(ie.type==="svg"?oe="svg":ie.type==="math"&&(oe="mathml"),J==null)T(ie,ge,Te,Oe,Z,oe,ve,xe);else{const Pe=J.el&&J.el._isVueCE?J.el:null;try{Pe&&Pe._beginPatch(),k(J,ie,Oe,Z,oe,ve,xe)}finally{Pe&&Pe._endPatch()}}},T=(J,ie,ge,Te,Oe,Z,oe,ve)=>{let xe,Pe;const{props:ze,shapeFlag:de,transition:Ie,dirs:it}=J;if(xe=J.el=a(J.type,Z,ze&&ze.is,ze),de&8?c(xe,J.children):de&16&&P(J.children,xe,null,Te,Oe,TR(J,Z),oe,ve),it&&Kl(J,null,Te,"created"),C(xe,J,J.scopeId,oe,Te),ze){for(const D in ze)D!=="value"&&!lu(D)&&o(xe,D,null,ze[D],Z,Te);"value"in ze&&o(xe,"value",null,ze.value,Z),(Pe=ze.onVnodeBeforeMount)&&pa(Pe,Te,J)}it&&Kl(J,null,Te,"beforeMount");const Y=aj(Oe,Ie);Y&&Ie.beforeEnter(xe),r(xe,ie,ge),((Pe=ze&&ze.onVnodeMounted)||Y||it)&&fi(()=>{Pe&&pa(Pe,Te,J),Y&&Ie.enter(xe),it&&Kl(J,null,Te,"mounted")},Oe)},C=(J,ie,ge,Te,Oe)=>{if(ge&&d(J,ge),Te)for(let Z=0;Z{for(let Pe=xe;Pe{const ve=ie.el=J.el;let{patchFlag:xe,dynamicChildren:Pe,dirs:ze}=ie;xe|=J.patchFlag&16;const de=J.props||gn,Ie=ie.props||gn;let it;if(ge&&Wd(ge,!1),(it=Ie.onVnodeBeforeUpdate)&&pa(it,ge,ie,J),ze&&Kl(ie,J,ge,"beforeUpdate"),ge&&Wd(ge,!0),(de.innerHTML&&Ie.innerHTML==null||de.textContent&&Ie.textContent==null)&&c(ve,""),Pe?L(J.dynamicChildren,Pe,ve,ge,Te,TR(ie,Oe),Z):oe||G(J,ie,ve,null,ge,Te,TR(ie,Oe),Z,!1),xe>0){if(xe&16)O(ve,de,Ie,ge,Oe);else if(xe&2&&de.class!==Ie.class&&o(ve,"class",null,Ie.class,Oe),xe&4&&o(ve,"style",de.style,Ie.style,Oe),xe&8){const Y=ie.dynamicProps;for(let D=0;D{it&&pa(it,ge,ie,J),ze&&Kl(ie,J,ge,"updated")},Te)},L=(J,ie,ge,Te,Oe,Z,oe)=>{for(let ve=0;ve{if(ie!==ge){if(ie!==gn)for(const Z in ie)!lu(Z)&&!(Z in ge)&&o(J,Z,ie[Z],null,Oe,Te);for(const Z in ge){if(lu(Z))continue;const oe=ge[Z],ve=ie[Z];oe!==ve&&Z!=="value"&&o(J,Z,ve,oe,Oe,Te)}"value"in ge&&o(J,"value",ie.value,ge.value,Oe)}},M=(J,ie,ge,Te,Oe,Z,oe,ve,xe)=>{const Pe=ie.el=J?J.el:s(""),ze=ie.anchor=J?J.anchor:s("");let{patchFlag:de,dynamicChildren:Ie,slotScopeIds:it}=ie;it&&(ve=ve?ve.concat(it):it),J==null?(r(Pe,ge,Te),r(ze,ge,Te),P(ie.children||[],ge,ze,Oe,Z,oe,ve,xe)):de>0&&de&64&&Ie&&J.dynamicChildren&&J.dynamicChildren.length===Ie.length?(L(J.dynamicChildren,Ie,ge,Oe,Z,oe,ve),(ie.key!=null||Oe&&ie===Oe.subTree)&&lM(J,ie,!0)):G(J,ie,ge,ze,Oe,Z,oe,ve,xe)},F=(J,ie,ge,Te,Oe,Z,oe,ve,xe)=>{ie.slotScopeIds=ve,J==null?ie.shapeFlag&512?Oe.ctx.activate(ie,ge,Te,oe,xe):U(ie,ge,Te,Oe,Z,oe,xe):X(J,ie,xe)},U=(J,ie,ge,Te,Oe,Z,oe)=>{const ve=J.component=gj(J,Te,Oe);if(D_(J)&&(ve.ctx.renderer=Ue),yj(ve,!1,oe),ve.asyncDep){if(Oe&&Oe.registerDep(ve,$,oe),!J.el){const xe=ve.subTree=B(ii);m(null,xe,ie,ge),J.placeholder=xe.el}}else $(ve,J,ie,ge,Oe,Z,oe)},X=(J,ie,ge)=>{const Te=ie.component=J.component;if(Spe(J,ie,ge))if(Te.asyncDep&&!Te.asyncResolved){W(Te,ie,ge);return}else Te.next=ie,Te.update();else ie.el=J.el,Te.vnode=ie},$=(J,ie,ge,Te,Oe,Z,oe)=>{const ve=()=>{if(J.isMounted){let{next:de,bu:Ie,u:it,parent:Y,vnode:D}=J;{const _e=sj(J);if(_e){de&&(de.el=D.el,W(J,de,oe)),_e.asyncDep.then(()=>{fi(()=>{J.isUnmounted||Pe()},Oe)});return}}let A=de,H;Wd(J,!1),de?(de.el=D.el,W(J,de,oe)):de=D,Ie&&tp(Ie),(H=de.props&&de.props.onVnodeBeforeUpdate)&&pa(H,Y,de,D),Wd(J,!0);const q=Jx(J),le=J.subTree;J.subTree=q,v(le,q,f(le.el),fe(le),J,Oe,Z),de.el=q.el,A===null&&bI(J,q.el),it&&fi(it,Oe),(H=de.props&&de.props.onVnodeUpdated)&&fi(()=>pa(H,Y,de,D),Oe)}else{let de;const{el:Ie,props:it}=ie,{bm:Y,m:D,parent:A,root:H,type:q}=J,le=bc(ie);if(Wd(J,!1),Y&&tp(Y),!le&&(de=it&&it.onVnodeBeforeMount)&&pa(de,A,ie),Wd(J,!0),Ie&&Xe){const _e=()=>{J.subTree=Jx(J),Xe(Ie,J.subTree,J,Oe,null)};le&&q.__asyncHydrate?q.__asyncHydrate(Ie,J,_e):_e()}else{H.ce&&H.ce._hasShadowRoot()&&H.ce._injectChildStyle(q,J.parent?J.parent.type:void 0);const _e=J.subTree=Jx(J);v(null,_e,ge,Te,J,Oe,Z),ie.el=_e.el}if(D&&fi(D,Oe),!le&&(de=it&&it.onVnodeMounted)){const _e=ie;fi(()=>pa(de,A,_e),Oe)}(ie.shapeFlag&256||A&&bc(A.vnode)&&A.vnode.shapeFlag&256)&&J.a&&fi(J.a,Oe),J.isMounted=!0,ie=ge=Te=null}};J.scope.on();const xe=J.effect=new s1(ve);J.scope.off();const Pe=J.update=xe.run.bind(xe),ze=J.job=xe.runIfDirty.bind(xe);ze.i=J,ze.id=J.uid,xe.scheduler=()=>KN(ze),Wd(J,!0),Pe()},W=(J,ie,ge)=>{ie.component=J;const Te=J.vnode.props;J.vnode=ie,J.next=null,xpe(J,ie.props,Te,ge),Ipe(J,ie.children,ge),Oc(),OB(J),Lc()},G=(J,ie,ge,Te,Oe,Z,oe,ve,xe=!1)=>{const Pe=J&&J.children,ze=J?J.shapeFlag:0,de=ie.children,{patchFlag:Ie,shapeFlag:it}=ie;if(Ie>0){if(Ie&128){ne(Pe,de,ge,Te,Oe,Z,oe,ve,xe);return}else if(Ie&256){Q(Pe,de,ge,Te,Oe,Z,oe,ve,xe);return}}it&8?(ze&16&&be(Pe,Oe,Z),de!==Pe&&c(ge,de)):ze&16?it&16?ne(Pe,de,ge,Te,Oe,Z,oe,ve,xe):be(Pe,Oe,Z,!0):(ze&8&&c(ge,""),it&16&&P(de,ge,Te,Oe,Z,oe,ve,xe))},Q=(J,ie,ge,Te,Oe,Z,oe,ve,xe)=>{J=J||Qh,ie=ie||Qh;const Pe=J.length,ze=ie.length,de=Math.min(Pe,ze);let Ie;for(Ie=0;Ieze?be(J,Oe,Z,!0,!1,de):P(ie,ge,Te,Oe,Z,oe,ve,xe,de)},ne=(J,ie,ge,Te,Oe,Z,oe,ve,xe)=>{let Pe=0;const ze=ie.length;let de=J.length-1,Ie=ze-1;for(;Pe<=de&&Pe<=Ie;){const it=J[Pe],Y=ie[Pe]=xe?rc(ie[Pe]):ga(ie[Pe]);if(sl(it,Y))v(it,Y,ge,null,Oe,Z,oe,ve,xe);else break;Pe++}for(;Pe<=de&&Pe<=Ie;){const it=J[de],Y=ie[Ie]=xe?rc(ie[Ie]):ga(ie[Ie]);if(sl(it,Y))v(it,Y,ge,null,Oe,Z,oe,ve,xe);else break;de--,Ie--}if(Pe>de){if(Pe<=Ie){const it=Ie+1,Y=itIe)for(;Pe<=de;)pe(J[Pe],Oe,Z,!0),Pe++;else{const it=Pe,Y=Pe,D=new Map;for(Pe=Y;Pe<=Ie;Pe++){const He=ie[Pe]=xe?rc(ie[Pe]):ga(ie[Pe]);He.key!=null&&D.set(He.key,Pe)}let A,H=0;const q=Ie-Y+1;let le=!1,_e=0;const he=new Array(q);for(Pe=0;Pe=q){pe(He,Oe,Z,!0);continue}let rt;if(He.key!=null)rt=D.get(He.key);else for(A=Y;A<=Ie;A++)if(he[A-Y]===0&&sl(He,ie[A])){rt=A;break}rt===void 0?pe(He,Oe,Z,!0):(he[rt-Y]=Pe+1,rt>=_e?_e=rt:le=!0,v(He,ie[rt],ge,null,Oe,Z,oe,ve,xe),H++)}const Ge=le?Ape(he):Qh;for(A=Ge.length-1,Pe=q-1;Pe>=0;Pe--){const He=Y+Pe,rt=ie[He],je=ie[He+1],ut=He+1{const{el:Z,type:oe,transition:ve,children:xe,shapeFlag:Pe}=J;if(Pe&6){re(J.component.subTree,ie,ge,Te);return}if(Pe&128){J.suspense.move(ie,ge,Te);return}if(Pe&64){oe.move(J,ie,ge,Ue);return}if(oe===$e){r(Z,ie,ge);for(let de=0;deve.enter(Z),Oe));else{const{leave:de,delayLeave:Ie,afterLeave:it}=ve,Y=()=>{J.ctx.isUnmounted?i(Z):r(Z,ie,ge)},D=()=>{const A=Z._isLeaving||!!Z[Ss];Z._isLeaving&&Z[Ss](!0),ve.persisted&&!A?Y():de(Z,()=>{Y(),it&&it()})};Ie?Ie(Z,Y,D):D()}else r(Z,ie,ge)},pe=(J,ie,ge,Te=!1,Oe=!1)=>{const{type:Z,props:oe,ref:ve,children:xe,dynamicChildren:Pe,shapeFlag:ze,patchFlag:de,dirs:Ie,cacheIndex:it,memo:Y}=J;if(de===-2&&(Oe=!1),ve!=null&&(Oc(),Lg(ve,null,ge,J,!0),Lc()),it!=null&&(ie.renderCache[it]=void 0),ze&256){ie.ctx.deactivate(J);return}const D=ze&1&&Ie,A=!bc(J);let H;if(A&&(H=oe&&oe.onVnodeBeforeUnmount)&&pa(H,ie,J),ze&6)Me(J.component,ge,Te);else{if(ze&128){J.suspense.unmount(ge,Te);return}D&&Kl(J,null,ie,"beforeUnmount"),ze&64?J.type.remove(J,ie,ge,Ue,Te):Pe&&!Pe.hasOnce&&(Z!==$e||de>0&&de&64)?be(Pe,ie,ge,!1,!0):(Z===$e&&de&384||!Oe&&ze&16)&&be(xe,ie,ge),Te&&ke(J)}const q=Y!=null&&it==null;(A&&(H=oe&&oe.onVnodeUnmounted)||D||q)&&fi(()=>{H&&pa(H,ie,J),D&&Kl(J,null,ie,"unmounted"),q&&(J.el=null)},ge)},ke=J=>{const{type:ie,el:ge,anchor:Te,transition:Oe}=J;if(ie===$e){Re(ge,Te);return}if(ie===ip){w(J);return}const Z=()=>{i(ge),Oe&&!Oe.persisted&&Oe.afterLeave&&Oe.afterLeave()};if(J.shapeFlag&1&&Oe&&!Oe.persisted){const{leave:oe,delayLeave:ve}=Oe,xe=()=>oe(ge,Z);ve?ve(J.el,Z,xe):xe()}else Z()},Re=(J,ie)=>{let ge;for(;J!==ie;)ge=h(J),i(J),J=ge;i(ie)},Me=(J,ie,ge)=>{const{bum:Te,scope:Oe,job:Z,subTree:oe,um:ve,m:xe,a:Pe}=J;CE(xe),CE(Pe),Te&&tp(Te),Oe.stop(),Z&&(Z.flags|=8,pe(oe,J,ie,ge)),ve&&fi(ve,ie),fi(()=>{J.isUnmounted=!0},ie)},be=(J,ie,ge,Te=!1,Oe=!1,Z=0)=>{for(let oe=Z;oe{if(J.shapeFlag&6)return fe(J.component.subTree);if(J.shapeFlag&128)return J.suspense.next();const ie=h(J.anchor||J.el),ge=ie&&ie[AY];return ge?h(ge):ie};let Le=!1;const Ce=(J,ie,ge)=>{let Te;J==null?ie._vnode&&(pe(ie._vnode,null,null,!0),Te=ie._vnode.component):v(ie._vnode||null,J,ie,null,null,null,ge),ie._vnode=J,Le||(Le=!0,OB(Te),xE(),Le=!1)},Ue={p:v,um:pe,m:re,r:ke,mt:U,mc:P,pc:G,pbc:L,n:fe,o:e};let Be,Xe;return t&&([Be,Xe]=t(Ue)),{render:Ce,hydrate:Be,createApp:vpe(Ce,Be)}}function TR({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function Wd({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function aj(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function lM(e,t,n=!1){const r=e.children,i=t.children;if(gt(r)&>(i))for(let o=0;o>1,e[n[s]]0&&(t[r]=n[o-1]),n[o]=r)}}for(o=n.length,a=n[o-1];o-- >0;)n[o]=a,a=t[a];return n}function sj(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:sj(t)}function CE(e){if(e)for(let t=0;te.__isSuspense;let LD=0;const Rpe={name:"Suspense",__isSuspense:!0,process(e,t,n,r,i,o,a,s,l,u){if(e==null)Ppe(t,n,r,i,o,a,s,l,u);else{if(o&&o.deps>0&&!e.suspense.isInFallback){t.suspense=e.suspense,t.suspense.vnode=t,t.el=e.el;return}Dpe(e,t,n,r,i,a,s,l,u)}},hydrate:Ope,normalize:Lpe},kpe=Rpe;function v1(e,t){const n=e.props&&e.props[t];Vt(n)&&n()}function Ppe(e,t,n,r,i,o,a,s,l){const{p:u,o:{createElement:c}}=l,f=c("div"),h=e.suspense=uj(e,i,r,t,f,n,o,a,s,l);u(null,h.pendingBranch=e.ssContent,f,null,r,h,o,a),h.deps>0?(v1(e,"onPending"),v1(e,"onFallback"),u(null,e.ssFallback,t,n,r,null,o,a),Ng(h,e.ssFallback)):h.resolve(!1,!0)}function Dpe(e,t,n,r,i,o,a,s,{p:l,um:u,o:{createElement:c}}){const f=t.suspense=e.suspense;f.vnode=t,t.el=e.el;const h=t.ssContent,d=t.ssFallback,{activeBranch:p,pendingBranch:v,isInFallback:y,isHydrating:m}=f;if(v)f.pendingBranch=h,sl(v,h)?(l(v,h,f.hiddenContainer,null,i,f,o,a,s),f.deps<=0?f.resolve():y&&(m||(l(p,d,n,r,i,null,o,a,s),Ng(f,d)))):(f.pendingId=LD++,m?(f.isHydrating=!1,f.activeBranch=v):u(v,i,f),f.deps=0,f.effects.length=0,f.hiddenContainer=c("div"),y?(l(null,h,f.hiddenContainer,null,i,f,o,a,s),f.deps<=0?f.resolve():(l(p,d,n,r,i,null,o,a,s),Ng(f,d))):p&&sl(p,h)?(l(p,h,n,r,i,f,o,a,s),f.resolve(!0)):(l(null,h,f.hiddenContainer,null,i,f,o,a,s),f.deps<=0&&f.resolve()));else if(p&&sl(p,h))l(p,h,n,r,i,f,o,a,s),Ng(f,h);else if(v1(t,"onPending"),f.pendingBranch=h,h.shapeFlag&512?f.pendingId=h.component.suspenseId:f.pendingId=LD++,l(null,h,f.hiddenContainer,null,i,f,o,a,s),f.deps<=0)f.resolve();else{const{timeout:b,pendingId:S}=f;b>0?setTimeout(()=>{f.pendingId===S&&f.fallback(d)},b):b===0&&f.fallback(d)}}function uj(e,t,n,r,i,o,a,s,l,u,c=!1){const{p:f,m:h,um:d,n:p,o:{parentNode:v,remove:y}}=u;let m;const b=Npe(e);b&&t&&t.pendingBranch&&(m=t.pendingId,t.deps++);const S=e.props?a1(e.props.timeout):void 0,w=o,x={vnode:e,parent:t,parentComponent:n,namespace:a,container:r,hiddenContainer:i,deps:0,pendingId:LD++,timeout:typeof S=="number"?S:-1,activeBranch:null,isFallbackMountPending:!1,pendingBranch:null,isInFallback:!c,isHydrating:c,isUnmounted:!1,effects:[],resolve(T=!1,C=!1){const{vnode:P,activeBranch:k,pendingBranch:L,pendingId:O,effects:M,parentComponent:F,container:U,isInFallback:X}=x;let $=!1;if(x.isHydrating)x.isHydrating=!1;else if(!T){$=k&&L.transition&&L.transition.mode==="out-in";let Q=!1;$&&(k.transition.afterLeave=()=>{O===x.pendingId&&(h(L,U,o===w&&!Q?p(k):o,0),c1(M),X&&P.ssFallback&&(P.ssFallback.el=null))}),k&&!x.isFallbackMountPending&&(v(k.el)===U&&(o=p(k),Q=!0),d(k,F,x,!0),!$&&X&&P.ssFallback&&fi(()=>P.ssFallback.el=null,x)),$||h(L,U,o,0)}x.isFallbackMountPending=!1,Ng(x,L),x.pendingBranch=null,x.isInFallback=!1;let W=x.parent,G=!1;for(;W;){if(W.pendingBranch){W.effects.push(...M),G=!0;break}W=W.parent}!G&&!$&&c1(M),x.effects=[],b&&t&&t.pendingBranch&&m===t.pendingId&&(t.deps--,t.deps===0&&!C&&t.resolve()),v1(P,"onResolve")},fallback(T){if(!x.pendingBranch)return;const{vnode:C,activeBranch:P,parentComponent:k,container:L,namespace:O}=x;v1(C,"onFallback");const M=p(P),F=()=>{x.isFallbackMountPending=!1,x.isInFallback&&(f(null,T,L,M,k,null,O,s,l),Ng(x,T))},U=T.transition&&T.transition.mode==="out-in";U&&(x.isFallbackMountPending=!0,P.transition.afterLeave=F),x.isInFallback=!0,d(P,k,null,!0),U||F()},move(T,C,P){x.activeBranch&&h(x.activeBranch,T,C,P),x.container=T},next(){return x.activeBranch&&p(x.activeBranch)},registerDep(T,C,P){const k=!!x.pendingBranch;k&&x.deps++;const L=T.vnode.el;T.asyncDep.catch(O=>{zp(O,T,0)}).then(O=>{if(T.isUnmounted||x.isUnmounted||x.pendingId!==T.suspenseId)return;m1(),T.asyncResolved=!0;const{vnode:M}=T;ND(T,O,!1),L&&(M.el=L);const F=!L&&T.subTree.el;C(T,M,v(L||T.subTree.el),L?null:p(T.subTree),x,a,P),F&&(M.placeholder=null,y(F)),bI(T,M.el),k&&--x.deps===0&&x.resolve()})},unmount(T,C){x.isUnmounted=!0,x.activeBranch&&d(x.activeBranch,n,T,C),x.pendingBranch&&d(x.pendingBranch,n,T,C)}};return x}function Ope(e,t,n,r,i,o,a,s,l){const u=t.suspense=uj(t,r,n,e.parentNode,document.createElement("div"),null,i,o,a,s,!0),c=l(e,u.pendingBranch=t.ssContent,n,u,o,a);return u.deps===0&&u.resolve(!1,!0),c}function Lpe(e){const{shapeFlag:t,children:n}=e,r=t&32;e.ssContent=jB(r?n.default:n),e.ssFallback=r?jB(n.fallback):B(ii)}function jB(e){let t;if(Vt(e)){const n=Sp&&e._c;n&&(e._d=!1,V()),e=e(),n&&(e._d=!0,t=Eo,fj())}return gt(e)&&(e=ype(e)),e=ga(e),t&&!e.dynamicChildren&&(e.dynamicChildren=t.filter(n=>n!==e)),e}function cj(e,t){t&&t.pendingBranch?gt(e)?t.effects.push(...e):t.effects.push(e):c1(e)}function Ng(e,t){e.activeBranch=t;const{vnode:n,parentComponent:r}=e;let i=t.el;for(;!i&&t.component;)t=t.component.subTree,i=t.el;n.el=i,r&&r.subTree===n&&(r.vnode.el=i,bI(r,i))}function Npe(e){const t=e.props&&e.props.suspensible;return t!=null&&t!==!1}const $e=Symbol.for("v-fgt"),_c=Symbol.for("v-txt"),ii=Symbol.for("v-cmt"),ip=Symbol.for("v-stc"),Sb=[];let Eo=null;function V(e=!1){Sb.push(Eo=e?null:[])}function fj(){Sb.pop(),Eo=Sb[Sb.length-1]||null}let Sp=1;function g1(e,t=!1){Sp+=e,e<0&&Eo&&t&&(Eo.hasOnce=!0)}function dj(e){return e.dynamicChildren=Sp>0?Eo||Qh:null,fj(),Sp>0&&Eo&&Eo.push(e),e}function j(e,t,n,r,i,o){return dj(I(e,t,n,r,i,o,!0))}function qe(e,t,n,r,i){return dj(B(e,t,n,r,i,!0))}function ns(e){return e?e.__v_isVNode===!0:!1}function sl(e,t){return e.type===t.type&&e.key===t.key}function Mpe(e){}const hj=({key:e})=>e??null,Qx=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?zt(e)||st(e)||Vt(e)?{i:eo,r:e,k:t,f:!!n}:e:null);function I(e,t=null,n=null,r=0,i=null,o=e===$e?0:1,a=!1,s=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&hj(t),ref:t&&Qx(t),scopeId:pI,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:o,patchFlag:r,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:eo};return s?(uM(l,n),o&128&&e.normalize(l)):n&&(l.shapeFlag|=zt(n)?8:16),Sp>0&&!a&&Eo&&(l.patchFlag>0||o&6)&&l.patchFlag!==32&&Eo.push(l),l}const B=Fpe;function Fpe(e,t=null,n=null,r=0,i=null,o=!1){if((!e||e===GY)&&(e=ii),ns(e)){const s=Su(e,t,!0);return n&&uM(s,n),Sp>0&&!o&&Eo&&(s.shapeFlag&6?Eo[Eo.indexOf(e)]=s:Eo.push(s)),s.patchFlag=-2,s}if(zpe(e)&&(e=e.__vccOpts),t){t=pj(t);let{class:s,style:l}=t;s&&!zt(s)&&(t.class=tt(s)),On(l)&&(k_(l)&&!gt(l)&&(l=pn({},l)),t.style=sn(l))}const a=zt(e)?1:IE(e)?128:RY(e)?64:On(e)?4:Vt(e)?2:0;return I(e,t,n,r,i,a,o,!0)}function pj(e){return e?k_(e)||JY(e)?pn({},e):e:null}function Su(e,t,n=!1,r=!1){const{props:i,ref:o,patchFlag:a,children:s,transition:l}=e,u=t?vj(i||{},t):i,c={__v_isVNode:!0,__v_skip:!0,type:e.type,props:u,key:u&&hj(u),ref:t&&t.ref?n&&o?gt(o)?o.concat(Qx(t)):[o,Qx(t)]:Qx(t):o,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:s,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==$e?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Su(e.ssContent),ssFallback:e.ssFallback&&Su(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&r&&Nc(c,l.clone(c)),c}function yt(e=" ",t=0){return B(_c,null,e,t)}function $pe(e,t){const n=B(ip,null,e);return n.staticCount=t,n}function Fe(e="",t=!1){return t?(V(),qe(ii,null,e)):B(ii,null,e)}function ga(e){return e==null||typeof e=="boolean"?B(ii):gt(e)?B($e,null,e.slice()):ns(e)?rc(e):B(_c,null,String(e))}function rc(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Su(e)}function uM(e,t){let n=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(gt(t))n=16;else if(typeof t=="object")if(r&65){const i=t.default;i&&(i._c&&(i._d=!1),uM(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!JY(t)?t._ctx=eo:i===3&&eo&&(eo.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Vt(t)?(t={default:t,_ctx:eo},n=32):(t=String(t),r&64?(n=16,t=[yt(t)]):n=8);e.children=t,e.shapeFlag|=n}function vj(...e){const t={};for(let n=0;nQi||eo;let AE,Mg;{const e=C_(),t=(n,r)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(r),o=>{i.length>1?i.forEach(a=>a(o)):i[0](o)}};AE=t("__VUE_INSTANCE_SETTERS__",n=>Qi=n),Mg=t("__VUE_SSR_SETTERS__",n=>wp=n)}const iy=e=>{const t=Qi;return AE(e),e.scope.on(),()=>{e.scope.off(),AE(t)}},m1=()=>{Qi&&Qi.scope.off(),AE(null)};function mj(e){return e.vnode.shapeFlag&4}let wp=!1;function yj(e,t=!1,n=!1){t&&Mg(t);const{props:r,children:i}=e.vnode,o=mj(e);wpe(e,r,o,t),Cpe(e,i,n||t);const a=o?Upe(e,t):void 0;return t&&Mg(!1),a}function Upe(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,kD);const{setup:r}=n;if(r){Oc();const i=e.setupContext=r.length>1?_j(e):null,o=iy(e),a=ry(r,e,0,[e.props,i]),s=sI(a);if(Lc(),o(),(s||e.sp)&&!bc(e)&&eM(e),s){if(a.then(m1,m1),t)return a.then(l=>{ND(e,l,t)}).catch(l=>{zp(l,e,0)});e.asyncDep=a}else ND(e,a,t)}else bj(e,t)}function ND(e,t,n){Vt(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:On(t)&&(e.setupState=jN(t)),bj(e,n)}let RE,MD;function Gpe(e){RE=e,MD=t=>{t.render._rc&&(t.withProxy=new Proxy(t.ctx,Zhe))}}const Hpe=()=>!RE;function bj(e,t,n){const r=e.type;if(!e.render){if(!t&&RE&&!r.render){const i=r.template||oM(e).template;if(i){const{isCustomElement:o,compilerOptions:a}=e.appContext.config,{delimiters:s,compilerOptions:l}=r,u=pn(pn({isCustomElement:o,delimiters:s},a),l);r.render=RE(i,u)}}e.render=r.render||Fi,MD&&MD(e)}{const i=iy(e);Oc();try{upe(e)}finally{Lc(),i()}}}const Wpe={get(e,t){return _o(e,"get",""),e[t]}};function _j(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,Wpe),slots:e.slots,emit:e.emit,expose:t}}function N_(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(jN(vY(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in _b)return _b[n](e)},has(t,n){return n in t||n in _b}})):e.proxy}function FD(e,t=!0){return Vt(e)?e.displayName||e.name:e.name||t&&e.__name}function zpe(e){return Vt(e)&&"__vccOpts"in e}const ae=(e,t)=>ahe(e,t,wp);function Wn(e,t,n){try{g1(-1);const r=arguments.length;return r===2?On(t)&&!gt(t)?ns(t)?B(e,null,[t]):B(e,t):B(e,null,t):(r>3?n=Array.prototype.slice.call(arguments,2):r===3&&ns(n)&&(n=[n]),B(e,t,n))}finally{g1(1)}}function Ype(){}function Sj(e,t,n,r){const i=n[r];if(i&&wj(i,e))return i;const o=t();return o.memo=e.slice(),o.cacheIndex=r,n[r]=o}function wj(e,t){const n=e.memo;if(n.length!=t.length)return!1;for(let r=0;r0&&Eo&&Eo.push(e),!0}const xj="3.5.38",jpe=Fi,Xpe=vhe,Kpe=qv,Zpe=xY,Jpe={createComponentInstance:gj,setupComponent:yj,renderComponentRoot:Jx,setCurrentRenderingInstance:d1,isVNode:ns,normalizeVNode:ga,getComponentPublicInstance:N_,ensureValidVNode:iM,pushWarningContext:fhe,popWarningContext:dhe},Qpe=Jpe,qpe=null,eve=null,tve=null;let $D;const XB=typeof window<"u"&&window.trustedTypes;if(XB)try{$D=XB.createPolicy("vue",{createHTML:e=>e})}catch{}const Tj=$D?e=>$D.createHTML(e):e=>e,nve="http://www.w3.org/2000/svg",rve="http://www.w3.org/1998/Math/MathML",qu=typeof document<"u"?document:null,KB=qu&&qu.createElement("template"),Ej={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,r)=>{const i=t==="svg"?qu.createElementNS(nve,e):t==="mathml"?qu.createElementNS(rve,e):n?qu.createElement(e,{is:n}):qu.createElement(e);return e==="select"&&r&&r.multiple!=null&&i.setAttribute("multiple",r.multiple),i},createText:e=>qu.createTextNode(e),createComment:e=>qu.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>qu.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,r,i,o){const a=n?n.previousSibling:t.lastChild;if(i&&(i===o||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===o||!(i=i.nextSibling)););else{KB.innerHTML=Tj(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const s=KB.content;if(r==="svg"||r==="mathml"){const l=s.firstChild;for(;l.firstChild;)s.appendChild(l.firstChild);s.removeChild(l)}t.insertBefore(s,n)}return[a?a.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},lf="transition",n0="animation",om=Symbol("_vtc"),Cj={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Ij=pn({},qN,Cj),ive=e=>(e.displayName="Transition",e.props=Ij,e),y1=ive((e,{slots:t})=>Wn(DY,Aj(e),t)),zd=(e,t=[])=>{gt(e)?e.forEach(n=>n(...t)):e&&e(...t)},ZB=e=>e?gt(e)?e.some(t=>t.length>1):e.length>1:!1;function Aj(e){const t={};for(const M in e)M in Cj||(t[M]=e[M]);if(e.css===!1)return t;const{name:n="v",type:r,duration:i,enterFromClass:o=`${n}-enter-from`,enterActiveClass:a=`${n}-enter-active`,enterToClass:s=`${n}-enter-to`,appearFromClass:l=o,appearActiveClass:u=a,appearToClass:c=s,leaveFromClass:f=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:d=`${n}-leave-to`}=e,p=ove(i),v=p&&p[0],y=p&&p[1],{onBeforeEnter:m,onEnter:b,onEnterCancelled:S,onLeave:w,onLeaveCancelled:x,onBeforeAppear:T=m,onAppear:C=b,onAppearCancelled:P=S}=t,k=(M,F,U,X)=>{M._enterCancelled=X,xf(M,F?c:s),xf(M,F?u:a),U&&U()},L=(M,F)=>{M._isLeaving=!1,xf(M,f),xf(M,d),xf(M,h),F&&F()},O=M=>(F,U)=>{const X=M?C:b,$=()=>k(F,M,U);zd(X,[F,$]),JB(()=>{xf(F,M?l:o),zl(F,M?c:s),ZB(X)||QB(F,r,v,$)})};return pn(t,{onBeforeEnter(M){zd(m,[M]),zl(M,o),zl(M,a)},onBeforeAppear(M){zd(T,[M]),zl(M,l),zl(M,u)},onEnter:O(!1),onAppear:O(!0),onLeave(M,F){M._isLeaving=!0;const U=()=>L(M,F);zl(M,f),M._enterCancelled?(zl(M,h),BD(M)):(BD(M),zl(M,h)),JB(()=>{M._isLeaving&&(xf(M,f),zl(M,d),ZB(w)||QB(M,r,y,U))}),zd(w,[M,U])},onEnterCancelled(M){k(M,!1,void 0,!0),zd(S,[M])},onAppearCancelled(M){k(M,!0,void 0,!0),zd(P,[M])},onLeaveCancelled(M){L(M),zd(x,[M])}})}function ove(e){if(e==null)return null;if(On(e))return[ER(e.enter),ER(e.leave)];{const t=ER(e);return[t,t]}}function ER(e){return a1(e)}function zl(e,t){t.split(/\s+/).forEach(n=>n&&e.classList.add(n)),(e[om]||(e[om]=new Set)).add(t)}function xf(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const n=e[om];n&&(n.delete(t),n.size||(e[om]=void 0))}function JB(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ave=0;function QB(e,t,n,r){const i=e._endId=++ave,o=()=>{i===e._endId&&r()};if(n!=null)return setTimeout(o,n);const{type:a,timeout:s,propCount:l}=Rj(e,t);if(!a)return r();const u=a+"end";let c=0;const f=()=>{e.removeEventListener(u,h),o()},h=d=>{d.target===e&&++c>=l&&f()};setTimeout(()=>{c(n[p]||"").split(", "),i=r(`${lf}Delay`),o=r(`${lf}Duration`),a=qB(i,o),s=r(`${n0}Delay`),l=r(`${n0}Duration`),u=qB(s,l);let c=null,f=0,h=0;t===lf?a>0&&(c=lf,f=a,h=o.length):t===n0?u>0&&(c=n0,f=u,h=l.length):(f=Math.max(a,u),c=f>0?a>u?lf:n0:null,h=c?c===lf?o.length:l.length:0);const d=c===lf&&/\b(?:transform|all)(?:,|$)/.test(r(`${lf}Property`).toString());return{type:c,timeout:f,propCount:h,hasTransform:d}}function qB(e,t){for(;e.lengtheV(n)+eV(e[r])))}function eV(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function BD(e){return(e?e.ownerDocument:document).body.offsetHeight}function sve(e,t,n){const r=e[om];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const kE=Symbol("_vod"),cM=Symbol("_vsh"),op={name:"show",beforeMount(e,{value:t},{transition:n}){e[kE]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):r0(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:r}){!t!=!n&&(r?t?(r.beforeEnter(e),r0(e,!0),r.enter(e)):r.leave(e,()=>{r0(e,!1)}):r0(e,t))},beforeUnmount(e,{value:t}){r0(e,t)}};function r0(e,t){e.style.display=t?e[kE]:"none",e[cM]=!t}function lve(){op.getSSRProps=({value:e})=>{if(!e)return{style:{display:"none"}}}}const kj=Symbol("");function uve(e){const t=vi();if(!t)return;const n=t.ut=(i=e(t.proxy))=>{Array.from(document.querySelectorAll(`[data-v-owner="${t.uid}"]`)).forEach(o=>PE(o,i))},r=()=>{const i=e(t.proxy);t.ce?PE(t.ce,i):VD(t.subTree,i),n(i)};tM(()=>{c1(r)}),Sr(()=>{et(r,Fi,{flush:"post"});const i=new MutationObserver(r);i.observe(t.subTree.el.parentNode,{childList:!0}),Do(()=>i.disconnect())})}function VD(e,t){if(e.shapeFlag&128){const n=e.suspense;e=n.activeBranch,n.pendingBranch&&!n.isHydrating&&n.effects.push(()=>{VD(n.activeBranch,t)})}for(;e.component;)e=e.component.subTree;if(e.shapeFlag&1&&e.el)PE(e.el,t);else if(e.type===$e)e.children.forEach(n=>VD(n,t));else if(e.type===ip){let{el:n,anchor:r}=e;for(;n&&(PE(n,t),n!==r);)n=n.nextSibling}}function PE(e,t){if(e.nodeType===1){const n=e.style;let r="";for(const i in t){const o=Q7(t[i]);n.setProperty(`--${i}`,o),r+=`--${i}: ${o};`}n[kj]=r}}const cve=/(?:^|;)\s*display\s*:/;function fve(e,t,n){const r=e.style,i=zt(n);let o=!1;if(n&&!i){if(t)if(zt(t))for(const a of t.split(";")){const s=a.slice(0,a.indexOf(":")).trim();n[s]==null&&Q0(r,s,"")}else for(const a in t)n[a]==null&&Q0(r,a,"");for(const a in n){a==="display"&&(o=!0);const s=n[a];s!=null?hve(e,a,!zt(t)&&t?t[a]:void 0,s)||Q0(r,a,s):Q0(r,a,"")}}else if(i){if(t!==n){const a=r[kj];a&&(n+=";"+a),r.cssText=n,o=cve.test(n)}}else t&&e.removeAttribute("style");kE in e&&(e[kE]=o?r.display:"",e[cM]&&(r.display="none"))}const tV=/\s*!important$/;function Q0(e,t,n){if(gt(n))n.forEach(r=>Q0(e,t,r));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const r=dve(e,t);tV.test(n)?e.setProperty(wo(r),n.replace(tV,""),"important"):e[r]=n}}const nV=["Webkit","Moz","ms"],CR={};function dve(e,t){const n=CR[t];if(n)return n;let r=ir(t);if(r!=="filter"&&r in e)return CR[t]=r;r=wd(r);for(let i=0;iIR||(mve.then(()=>IR=0),IR=Date.now());function bve(e,t){const n=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=n.attached)return;const i=n.value;if(gt(i)){const o=r.stopImmediatePropagation;r.stopImmediatePropagation=()=>{o.call(r),r._stopped=!0};const a=i.slice(),s=[r];for(let l=0;le.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pj=(e,t,n,r,i,o)=>{const a=i==="svg";t==="class"?sve(e,r,a):t==="style"?fve(e,n,r):_d(t)?w_(t)||vve(e,t,n,r,o):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):_ve(e,t,r,a))?(oV(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&iV(e,t,r,a,o,t!=="value")):e._isVueCE&&(Sve(e,t)||e._def.__asyncLoader&&(/[A-Z]/.test(t)||!zt(r)))?oV(e,ir(t),r,o,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),iV(e,t,r,a))};function _ve(e,t,n,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&lV(t)&&Vt(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return lV(t)&&zt(n)?!1:t in e}function Sve(e,t){const n=e._def.props;if(!n)return!1;const r=ir(t);return Array.isArray(n)?n.some(i=>ir(i)===r):Object.keys(n).some(i=>ir(i)===r)}const uV={};function Dj(e,t,n){let r=Ye(e,t);x_(r)&&(r=pn({},r,t));class i extends _I{constructor(a){super(r,a,n)}}return i.def=r,i}const wve=((e,t)=>Dj(e,t,Wj)),xve=typeof HTMLElement<"u"?HTMLElement:class{};class _I extends xve{constructor(t,n={},r=sm){super(),this._def=t,this._props=n,this._createApp=r,this._isVueCE=!0,this._instance=null,this._app=null,this._nonce=this._def.nonce,this._connected=!1,this._resolved=!1,this._patching=!1,this._dirty=!1,this._numberProps=null,this._styleChildren=new WeakSet,this._styleAnchors=new WeakMap,this._ob=null,this.shadowRoot&&r!==sm?this._root=this.shadowRoot:t.shadowRoot!==!1?(this.attachShadow(pn({},t.shadowRootOptions,{mode:"open"})),this._root=this.shadowRoot):this._root=this}connectedCallback(){if(!this.isConnected)return;!this.shadowRoot&&!this._resolved&&this._parseSlots(),this._connected=!0;let t=this;for(;t=t&&(t.assignedSlot||t.parentNode||t.host);)if(t instanceof _I){this._parent=t;break}this._instance||(this._resolved?this._mount(this._def):t&&t._pendingResolve?this._pendingResolve=t._pendingResolve.then(()=>{this._pendingResolve=void 0,this._resolveDef()}):this._resolveDef())}_setParent(t=this._parent){t&&(this._instance.parent=t._instance,this._inheritParentContext(t))}_inheritParentContext(t=this._parent){t&&this._app&&Object.setPrototypeOf(this._app._context.provides,t._instance.provides)}disconnectedCallback(){this._connected=!1,Tr(()=>{this._connected||(this._ob&&(this._ob.disconnect(),this._ob=null),this._app&&this._app.unmount(),this._instance&&(this._instance.ce=void 0),this._app=this._instance=null,this._teleportTargets&&(this._teleportTargets.clear(),this._teleportTargets=void 0))})}_processMutations(t){for(const n of t)this._setAttr(n.attributeName)}_resolveDef(){if(this._pendingResolve)return;for(let r=0;r{this._resolved=!0,this._pendingResolve=void 0;const{props:o,styles:a}=r;let s;if(o&&!gt(o))for(const l in o){const u=o[l];(u===Number||u&&u.type===Number)&&(l in this._props&&(this._props[l]=a1(this._props[l])),(s||(s=Object.create(null)))[ir(l)]=!0)}this._numberProps=s,this._resolveProps(r),this.shadowRoot&&this._applyStyles(a),this._mount(r)},n=this._def.__asyncLoader;n?this._pendingResolve=n().then(r=>{r.configureApp=this._def.configureApp,t(this._def=r,!0)}):t(this._def)}_mount(t){this._app=this._createApp(t),this._inheritParentContext(),t.configureApp&&t.configureApp(this._app),this._app._ceVNode=this._createVNode(),this._app.mount(this._root);const n=this._instance&&this._instance.exposed;if(n)for(const r in n)Mn(this,r)||Object.defineProperty(this,r,{get:()=>R(n[r])})}_resolveProps(t){const{props:n}=t,r=gt(n)?n:Object.keys(n||{});for(const i of Object.keys(this))i[0]!=="_"&&r.includes(i)&&this._setProp(i,this[i]);for(const i of r.map(ir))Object.defineProperty(this,i,{get(){return this._getProp(i)},set(o){this._setProp(i,o,!0,!this._patching)}})}_setAttr(t){if(t.startsWith("data-v-"))return;const n=this.hasAttribute(t);let r=n?this.getAttribute(t):uV;const i=ir(t);n&&this._numberProps&&this._numberProps[i]&&(r=a1(r)),this._setProp(i,r,!1,!0)}_getProp(t){return this._props[t]}_setProp(t,n,r=!0,i=!1){if(n!==this._props[t]&&(this._dirty=!0,n===uV?delete this._props[t]:(this._props[t]=n,t==="key"&&this._app&&(this._app._ceVNode.key=n)),i&&this._instance&&this._update(),r)){const o=this._ob;o&&(this._processMutations(o.takeRecords()),o.disconnect()),n===!0?this.setAttribute(wo(t),""):typeof n=="string"||typeof n=="number"?this.setAttribute(wo(t),n+""):n||this.removeAttribute(wo(t)),o&&o.observe(this,{attributes:!0})}}_update(){const t=this._createVNode();this._app&&(t.appContext=this._app._context),Hj(t,this._root)}_createVNode(){const t={};this.shadowRoot||(t.onVnodeMounted=t.onVnodeUpdated=this._renderSlots.bind(this));const n=B(this._def,pn(t,this._props));return this._instance||(n.ce=r=>{this._instance=r,r.ce=this,r.isCE=!0;const i=(o,a)=>{this.dispatchEvent(new CustomEvent(o,x_(a[0])?pn({detail:a},a[0]):{detail:a}))};r.emit=(o,...a)=>{i(o,a),wo(o)!==o&&i(wo(o),a)},this._setParent()}),n}_applyStyles(t,n,r){if(!t)return;if(n){if(n===this._def||this._styleChildren.has(n))return;this._styleChildren.add(n)}const i=this._nonce,o=this.shadowRoot,a=r?this._getStyleAnchor(r)||this._getStyleAnchor(this._def):this._getRootStyleInsertionAnchor(o);let s=null;for(let l=t.length-1;l>=0;l--){const u=document.createElement("style");i&&u.setAttribute("nonce",i),u.textContent=t[l],o.insertBefore(u,s||a),s=u,l===0&&(r||this._styleAnchors.set(this._def,u),n&&this._styleAnchors.set(n,u))}}_getStyleAnchor(t){if(!t)return null;const n=this._styleAnchors.get(t);return n&&n.parentNode===this.shadowRoot?n:(n&&this._styleAnchors.delete(t),null)}_getRootStyleInsertionAnchor(t){for(let n=0;n(delete e.props.mode,e),Ive=Cve({name:"TransitionGroup",props:pn({},Ij,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=vi(),r=QN();let i,o;return O_(()=>{if(!i.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!Dve(i[0].el,n.vnode.el,a)){i=[];return}i.forEach(Rve),i.forEach(kve);const s=i.filter(Pve);BD(n.vnode.el),s.forEach(l=>{const u=l.el,c=u.style;zl(u,a),c.transform=c.webkitTransform=c.transitionDuration="";const f=u[DE]=h=>{h&&h.target!==u||(!h||h.propertyName.endsWith("transform"))&&(u.removeEventListener("transitionend",f),u[DE]=null,xf(u,a))};u.addEventListener("transitionend",f)}),i=[]}),()=>{const a=In(e),s=Aj(a);let l=a.tag||$e;if(i=[],o)for(let u=0;u{s.split(/\s+/).forEach(l=>l&&r.classList.remove(l))}),n.split(/\s+/).forEach(s=>s&&r.classList.add(s)),r.style.display="none";const o=t.nodeType===1?t:t.parentNode;o.appendChild(r);const{hasTransform:a}=Rj(r);return o.removeChild(r),a}const sd=e=>{const t=e.props["onUpdate:modelValue"]||!1;return gt(t)?n=>tp(t,n):t};function Ove(e){e.target.composing=!0}function fV(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Os=Symbol("_assign");function dV(e,t,n){return t&&(e=e.trim()),n&&(e=E_(e)),e}const Mr={created(e,{modifiers:{lazy:t,trim:n,number:r}},i){e[Os]=sd(i);const o=r||i.props&&i.props.type==="number";ac(e,t?"change":"input",a=>{a.target.composing||e[Os](dV(e.value,n,o))}),(n||o)&&ac(e,"change",()=>{e.value=dV(e.value,n,o)}),t||(ac(e,"compositionstart",Ove),ac(e,"compositionend",fV),ac(e,"change",fV))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:r,trim:i,number:o}},a){if(e[Os]=sd(a),e.composing)return;const s=(o||e.type==="number")&&!/^0\d/.test(e.value)?E_(e.value):e.value,l=t??"";if(s===l)return;const u=e.getRootNode();(u instanceof Document||u instanceof ShadowRoot)&&u.activeElement===e&&e.type!=="range"&&(r&&t===n||i&&e.value.trim()===l)||(e.value=l)}},qt={deep:!0,created(e,t,n){e[Os]=sd(n),ac(e,"change",()=>{const r=e._modelValue,i=am(e),o=e.checked,a=e[Os];if(gt(r)){const s=I_(r,i),l=s!==-1;if(o&&!l)a(r.concat(i));else if(!o&&l){const u=[...r];u.splice(s,1),a(u)}}else if(Sd(r)){const s=new Set(r);o?s.add(i):s.delete(i),a(s)}else a(Fj(e,o))})},mounted:hV,beforeUpdate(e,t,n){e[Os]=sd(n),hV(e,t,n)}};function hV(e,{value:t,oldValue:n},r){e._modelValue=t;let i;if(gt(t))i=I_(t,r.props.value)>-1;else if(Sd(t))i=t.has(r.props.value);else{if(t===n)return;i=bu(t,Fj(e,!0))}e.checked!==i&&(e.checked=i)}const fM={created(e,{value:t},n){e.checked=bu(t,n.props.value),e[Os]=sd(n),ac(e,"change",()=>{e[Os](am(e))})},beforeUpdate(e,{value:t,oldValue:n},r){e[Os]=sd(r),t!==n&&(e.checked=bu(t,r.props.value))}},nr={deep:!0,created(e,{value:t,modifiers:{number:n}},r){const i=Sd(t);ac(e,"change",()=>{const o=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>n?E_(am(a)):am(a));e[Os](e.multiple?i?new Set(o):o:o[0]),e._assigning=!0,Tr(()=>{e._assigning=!1})}),e[Os]=sd(r)},mounted(e,{value:t}){pV(e,t)},beforeUpdate(e,t,n){e[Os]=sd(n)},updated(e,{value:t}){e._assigning||pV(e,t)}};function pV(e,t){const n=e.multiple,r=gt(t);if(!(n&&!r&&!Sd(t))){for(let i=0,o=e.options.length;iString(u)===String(s)):a.selected=I_(t,s)>-1}else a.selected=t.has(s);else if(bu(am(a),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function am(e){return"_value"in e?e._value:e.value}function Fj(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const $j={created(e,t,n){xw(e,t,n,null,"created")},mounted(e,t,n){xw(e,t,n,null,"mounted")},beforeUpdate(e,t,n,r){xw(e,t,n,r,"beforeUpdate")},updated(e,t,n,r){xw(e,t,n,r,"updated")}};function Bj(e,t){switch(e){case"SELECT":return nr;case"TEXTAREA":return Mr;default:switch(t){case"checkbox":return qt;case"radio":return fM;default:return Mr}}}function xw(e,t,n,r,i){const a=Bj(e.tagName,n.props&&n.props.type)[i];a&&a(e,t,n,r)}function Lve(){Mr.getSSRProps=({value:e})=>({value:e}),fM.getSSRProps=({value:e},t)=>{if(t.props&&bu(t.props.value,e))return{checked:!0}},qt.getSSRProps=({value:e},t)=>{if(gt(e)){if(t.props&&I_(e,t.props.value)>-1)return{checked:!0}}else if(Sd(e)){if(t.props&&e.has(t.props.value))return{checked:!0}}else if(e)return{checked:!0}},$j.getSSRProps=(e,t)=>{if(typeof t.type!="string")return;const n=Bj(t.type.toUpperCase(),t.props&&t.props.type);if(n.getSSRProps)return n.getSSRProps(e,t)}}const Nve=["ctrl","shift","alt","meta"],Mve={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Nve.some(n=>e[`${n}Key`]&&!t.includes(n))},Ot=(e,t)=>{if(!e)return e;const n=e._withMods||(e._withMods={}),r=t.join(".");return n[r]||(n[r]=((i,...o)=>{for(let a=0;a{const n=e._withKeys||(e._withKeys={}),r=t.join(".");return n[r]||(n[r]=(i=>{if(!("key"in i))return;const o=wo(i.key);if(t.some(a=>a===o||Fve[a]===o))return e(i)}))},Vj=pn({patchProp:Pj},Ej);let wb,vV=!1;function Uj(){return wb||(wb=rj(Vj))}function Gj(){return wb=vV?wb:ij(Vj),vV=!0,wb}const Hj=((...e)=>{Uj().render(...e)}),$ve=((...e)=>{Gj().hydrate(...e)}),sm=((...e)=>{const t=Uj().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=Yj(r);if(!i)return;const o=t._component;!Vt(o)&&!o.render&&!o.template&&(o.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const a=n(i,!1,zj(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),a},t}),Wj=((...e)=>{const t=Gj().createApp(...e),{mount:n}=t;return t.mount=r=>{const i=Yj(r);if(i)return n(i,!0,zj(i))},t});function zj(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Yj(e){return zt(e)?document.querySelector(e):e}let gV=!1;const Bve=()=>{gV||(gV=!0,Lve(),lve())},Vve=Object.freeze(Object.defineProperty({__proto__:null,BaseTransition:DY,BaseTransitionPropsValidators:qN,Comment:ii,DeprecationTypes:tve,EffectScope:GN,ErrorCodes:phe,ErrorTypeStrings:Xpe,Fragment:$e,KeepAlive:Hhe,ReactiveEffect:s1,Static:ip,Suspense:kpe,Teleport:JN,Text:_c,TrackOpTypes:she,Transition:y1,TransitionGroup:Ave,TriggerOpTypes:lhe,VueElement:_I,assertNumber:hhe,callWithAsyncErrorHandling:ts,callWithErrorHandling:ry,camelize:ir,capitalize:wd,cloneVNode:Su,compatUtils:eve,computed:ae,createApp:sm,createBlock:qe,createCommentVNode:Fe,createElementBlock:j,createElementVNode:I,createHydrationRenderer:ij,createPropsRestProxy:spe,createRenderer:rj,createSSRApp:Wj,createSlots:Xhe,createStaticVNode:$pe,createTextVNode:yt,createVNode:B,customRef:hI,defineAsyncComponent:Uhe,defineComponent:Ye,defineCustomElement:Dj,defineEmits:Qhe,defineExpose:qhe,defineModel:npe,defineOptions:epe,defineProps:Jhe,defineSSRCustomElement:wve,defineSlots:tpe,devtools:Kpe,effect:Lde,effectScope:q7,getCurrentInstance:vi,getCurrentScope:A_,getCurrentWatcher:uhe,getTransitionRawChildren:gI,guardReactiveProps:pj,h:Wn,handleError:zp,hasInjectionContext:ZN,hydrate:$ve,hydrateOnIdle:Nhe,hydrateOnInteraction:Bhe,hydrateOnMediaQuery:$he,hydrateOnVisible:Fhe,initCustomFormatter:Ype,initDirectivesForSSR:Bve,inject:Zo,isMemoSame:wj,isProxy:k_,isReactive:yc,isReadonly:_u,isRef:st,isRuntimeOnly:Hpe,isShallow:Ta,isVNode:ns,markRaw:vY,mergeDefaults:ape,mergeModels:p1,mergeProps:vj,nextTick:Tr,nodeOps:Ej,normalizeClass:tt,normalizeProps:G7,normalizeStyle:sn,onActivated:LY,onBeforeMount:FY,onBeforeUnmount:L_,onBeforeUpdate:tM,onDeactivated:NY,onErrorCaptured:UY,onMounted:Sr,onRenderTracked:VY,onRenderTriggered:BY,onScopeDispose:R_,onServerPrefetch:$Y,onUnmounted:Do,onUpdated:O_,onWatcherCleanup:yY,openBlock:V,patchProp:Pj,popScopeId:bhe,provide:Og,proxyRefs:jN,pushScopeId:yhe,queuePostFlushCb:c1,reactive:io,readonly:nm,ref:me,registerRuntimeCompiler:Gpe,render:Hj,renderList:Ct,renderSlot:Ea,resolveComponent:Yhe,resolveDirective:jhe,resolveDynamicComponent:Fr,resolveFilter:qpe,resolveTransitionHooks:im,setBlockTracking:g1,setDevtoolsHook:Zpe,setTransitionHooks:Nc,shallowReactive:YN,shallowReadonly:Pg,shallowRef:mn,ssrContextKey:TY,ssrUtils:Qpe,stop:Nde,toDisplayString:K,toHandlerKey:ep,toHandlers:Khe,toRaw:In,toRef:XN,toRefs:nhe,toValue:lr,transformVNodeArgs:Mpe,triggerRef:CD,unref:R,useAttrs:ope,useCssModule:Eve,useCssVars:uve,useHost:Oj,useId:Ihe,useModel:Yc,useSSRContext:EY,useShadowRoot:Tve,useSlots:ipe,useTemplateRef:Ahe,useTransitionState:QN,vModelCheckbox:qt,vModelDynamic:$j,vModelRadio:fM,vModelSelect:nr,vModelText:Mr,vShow:op,version:xj,warn:jpe,watch:et,watchEffect:vI,watchPostEffect:She,watchSyncEffect:CY,withAsyncContext:lpe,withCtx:Ze,withDefaults:rpe,withDirectives:at,withKeys:vl,withMemo:Sj,withModifiers:Ot,withScopeId:_he},Symbol.toStringTag,{value:"Module"}));function Uve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"})])}function M_(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m9 12.75 3 3m0 0 3-3m-3 3v-7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function jj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})])}function Gve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})])}function Hve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 9-3 3m0 0 3 3m-3-3h7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Wve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})])}function oy(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})])}function Mc(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m12.75 15 3-3m0 0-3-3m3 3h-7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function F_(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m15 11.25-3-3m0 0-3 3m3-3v7.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Xj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})])}function zve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.5 10.5 12 3m0 0 7.5 7.5M12 3v18"})])}function mV(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})])}function Yve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})])}function dM(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})])}function Kj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9h16.5m-16.5 6.75h16.5"})])}function Zj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})])}function jve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h9.75m4.5-4.5v12m0 0-3.75-3.75M17.25 21 21 17.25"})])}function Xve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 4.5h14.25M3 9h9.75M3 13.5h5.25m5.25-.75L17.25 9m0 0L21 12.75M17.25 9v12"})])}function $_(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})])}function Kve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Jj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})])}function AR(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function Qj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})])}function qj(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})])}function Zve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})])}function Jve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function B_(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function Qve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function UD(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"})])}function qve(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})])}function ege(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"})])}function tge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function nge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})])}function GD(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function hM(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"})])}function rge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25"})])}function ige(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 13.5h3.86a2.25 2.25 0 0 1 2.012 1.244l.256.512a2.25 2.25 0 0 0 2.013 1.244h3.218a2.25 2.25 0 0 0 2.013-1.244l.256-.512a2.25 2.25 0 0 1 2.013-1.244h3.859m-19.5.338V18a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18v-4.162c0-.224-.034-.447-.1-.661L19.24 5.338a2.25 2.25 0 0 0-2.15-1.588H6.911a2.25 2.25 0 0 0-2.15 1.588L2.35 13.177a2.25 2.25 0 0 0-.1.661Z"})])}function oge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})])}function eX(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.181 8.68a4.503 4.503 0 0 1 1.903 6.405m-9.768-2.782L3.56 14.06a4.5 4.5 0 0 0 6.364 6.365l3.129-3.129m5.614-5.615 1.757-1.757a4.5 4.5 0 0 0-6.364-6.365l-4.5 4.5c-.258.26-.479.541-.661.84m1.903 6.405a4.495 4.495 0 0 1-1.242-.88 4.483 4.483 0 0 1-1.062-1.683m6.587 2.345 5.907 5.907m-5.907-5.907L8.898 8.898M2.991 2.99 8.898 8.9"})])}function tX(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})])}function nX(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})])}function age(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M13.5 10.5V6.75a4.5 4.5 0 1 1 9 0v3.75M3.75 21.75h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H3.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})])}function yV(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM13.5 10.5h-6"})])}function bV(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM10.5 7.5v6m3-3h-6"})])}function sge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})])}function pM(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 10.5a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}),I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 10.5c0 7.142-7.5 11.25-7.5 11.25S4.5 17.642 4.5 10.5a7.5 7.5 0 1 1 15 0Z"})])}function rX(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"})])}function OE(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.25 9v6m-4.5 0V9M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function iX(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 5.25v13.5m-7.5-13.5v13.5"})])}function ld(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})])}function lge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function uge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m2.25 15.75 5.159-5.159a2.25 2.25 0 0 1 3.182 0l5.159 5.159m-1.5-1.5 1.409-1.409a2.25 2.25 0 0 1 3.182 0l2.909 2.909m-18 3.75h16.5a1.5 1.5 0 0 0 1.5-1.5V6a1.5 1.5 0 0 0-1.5-1.5H3.75A1.5 1.5 0 0 0 2.25 6v12a1.5 1.5 0 0 0 1.5 1.5Zm10.5-11.25h.008v.008h-.008V8.25Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})])}function LE(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}),I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.91 11.672a.375.375 0 0 1 0 .656l-5.603 3.113a.375.375 0 0 1-.557-.328V8.887c0-.286.307-.466.557-.327l5.603 3.112Z"})])}function oX(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})])}function Fc(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 4.5v15m7.5-7.5h-15"})])}function So(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})])}function cge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 7.125C2.25 6.504 2.754 6 3.375 6h6c.621 0 1.125.504 1.125 1.125v3.75c0 .621-.504 1.125-1.125 1.125h-6a1.125 1.125 0 0 1-1.125-1.125v-3.75ZM14.25 8.625c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v8.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-8.25ZM3.75 16.125c0-.621.504-1.125 1.125-1.125h5.25c.621 0 1.125.504 1.125 1.125v2.25c0 .621-.504 1.125-1.125 1.125h-5.25a1.125 1.125 0 0 1-1.125-1.125v-2.25Z"})])}function SI(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.75 17.25v-.228a4.5 4.5 0 0 0-.12-1.03l-2.268-9.64a3.375 3.375 0 0 0-3.285-2.602H7.923a3.375 3.375 0 0 0-3.285 2.602l-2.268 9.64a4.5 4.5 0 0 0-.12 1.03v.228m19.5 0a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3m19.5 0a3 3 0 0 0-3-3H5.25a3 3 0 0 0-3 3m16.5 0h.008v.008h-.008v-.008Zm-3 0h.008v.008h-.008v-.008Z"})])}function fge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25A2.25 2.25 0 0 1 13.5 18v-2.25Z"})])}function dge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4.098 19.902a3.75 3.75 0 0 0 5.304 0l6.401-6.402M6.75 21A3.75 3.75 0 0 1 3 17.25V4.125C3 3.504 3.504 3 4.125 3h5.25c.621 0 1.125.504 1.125 1.125v4.072M6.75 21a3.75 3.75 0 0 0 3.75-3.75V8.197M6.75 21h13.125c.621 0 1.125-.504 1.125-1.125v-5.25c0-.621-.504-1.125-1.125-1.125h-4.072M10.5 8.197l2.88-2.88c.438-.439 1.15-.439 1.59 0l3.712 3.713c.44.44.44 1.152 0 1.59l-2.879 2.88M6.75 17.25h.008v.008H6.75v-.008Z"})])}function hge(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6Z"})])}function Yp(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})])}function V_(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})])}function Ca(e,t){return V(),j("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[I("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 18 18 6M6 6l12 12"})])}const pge=/Mac|iPod|iPhone|iPad/.test(navigator.platform),q0="GLOBAL",aX="https://www.gstatic.com/generate_204",Xqe="https://ipv6.google.com/generate_204",Is=0;var Yo=(e=>(e.EN_US="en-US",e.ZH_CN="zh-CN",e.ZH_TW="zh-TW",e.RU_RU="ru-RU",e))(Yo||{}),go=(e=>(e.MI_SANS="MiSans",e.SARASA_UI="SarasaUi",e.PING_FANG="PingFang",e.FIRA_SANS="FiraSans",e.SYSTEM_UI="SystemUI",e))(go||{}),ap=(e=>(e.TWEMOJI="twemoji",e.NOTO_COLOR_EMOJI="noto-color-emoji",e))(ap||{}),Se=(e=>(e.Close="close",e.Type="type",e.Process="process",e.Host="host",e.Rule="rule",e.Chains="chains",e.Outbound="outbound",e.DlSpeed="dlSpeed",e.UlSpeed="ulSpeed",e.Download="dl",e.Upload="ul",e.ConnectTime="connectTime",e.SourceIP="sourceIP",e.SourcePort="sourcePort",e.SniffHost="sniffHost",e.Destination="destination",e.DestinationType="destinationType",e.GeoIP="geoip",e.RemoteAddress="remoteAddress",e.InboundUser="inboundUser",e.Protocol="protocol",e.OutboundType="outboundType",e.FromOutbound="fromOutbound",e))(Se||{}),wI=(e=>(e.AUTO="auto",e.MANUAL="manual",e))(wI||{}),nu=(e=>(e.DEFAULT="defaultsort",e.NAME_ASC="nameasc",e.NAME_DESC="namedesc",e.LATENCY_ASC="latencyasc",e.LATENCY_DESC="latencydesc",e))(nu||{}),b1=(e=>(e.AUTO="auto",e.DOTS="dots",e.BAR="bar",e))(b1||{}),sp=(e=>(e.GLOBAL="global",e.GROUP="group",e))(sp||{}),NE=(e=>(e.CORE="core",e.DASHBOARD="dashboard",e))(NE||{}),lp=(e=>(e.AUTO="auto",e.ON="on",e.OFF="off",e))(lp||{});const vge=20;var Sc=(e=>(e.AUTO="auto",e.CARD="card",e.TABLE="table",e))(Sc||{}),wc=(e=>(e.RULES="rules",e.PROVIDER="ruleProvider",e))(wc||{}),xo=(e=>(e.PROXIES="proxies",e.PROVIDER="proxyProvider",e))(xo||{}),Vo=(e=>(e.HOST="host",e.CHAINS="chains",e.RULE="rule",e.TYPE="type",e.CONNECT_TIME="connectTime",e.DOWNLOAD="download",e.DOWNLOAD_SPEED="downloadSpeed",e.UPLOAD="upload",e.UPLOAD_SPEED="uploadSpeed",e.SOURCE_IP="sourceIP",e.INBOUND_USER="inboundUser",e))(Vo||{}),Bh=(e=>(e.ASC="asc",e.DESC="desc",e))(Bh||{}),jp=(e=>(e.ACTIVE="activeConnections",e.CLOSED="closedConnections",e))(jp||{}),Yr=(e=>(e.Trace="trace",e.Debug="debug",e.Info="info",e.Warning="warning",e.Error="error",e.Fatal="fatal",e.Panic="panic",e.Silent="silent",e))(Yr||{}),un=(e=>(e.overview="overview",e.proxies="proxies",e.connections="connections",e.logs="logs",e.rules="rules",e.tools="tools",e.settings="settings",e.setup="setup",e))(un||{});const sX={overview:UD,proxies:hM,connections:dM,rules:dge,logs:qve,tools:V_,settings:B_,setup:UD};var _1=(e=>(e.SMALL="small",e.LARGE="large",e))(_1||{}),ay=(e=>(e.SMALL="small",e.LARGE="large",e))(ay||{}),HD=(e=>(e[e.SMALL=130]="SMALL",e[e.LARGE=145]="LARGE",e))(HD||{}),Xp=(e=>(e.NORMAL="normal",e.REVERSE="reverse",e))(Xp||{}),Uo=(e=>(e.Direct="direct",e.Reject="reject",e.RejectDrop="rejectdrop",e.Compatible="compatible",e.Pass="pass",e.Dns="dns",e.Selector="selector",e.Fallback="fallback",e.URLTest="urltest",e.Smart="smart",e.LoadBalance="loadbalance",e))(Uo||{});const gge=[["host","connectTime"],["chains","dlSpeed","close"]],lX=[["host","connectTime"],["type","dl","ul"],["chains","dlSpeed","close"]],S1=["light","dark","light-neutral","dark-neutral",...window.ksu?["light-monet","dark-monet"]:[],"halloween","forest","lofi","wireframe","black","dracula","business","night","dim","nord","sunset","abyss","cupcake","dark-daisyui5"],_V={name:"custom",id:"","--border":"1px","--color-base-100":"#ffffff","--color-base-200":"#fcfcfc","--color-base-300":"#f2f2f2","--color-base-content":"#2d2d33","--color-primary":"#5a3cd2","--color-primary-content":"#f3efff","--color-secondary":"#ea4c5a","--color-secondary-content":"#fff1f2","--color-accent":"#49c6c1","--color-accent-content":"#285e66","--color-neutral":"#1e1e1f","--color-neutral-content":"#ececec","--color-info":"#5b90ff","--color-info-content":"#273c66","--color-success":"#44c07a","--color-success-content":"#1d472f","--color-warning":"#e5a300","--color-warning-content":"#705322","--color-error":"#d13a30","--color-error-content":"#551d1d","--depth":"0","--noise":"0","--radius-box":"1rem","--radius-field":"0.5rem","--radius-selector":"1rem","--size-field":"0.25rem","--size-selector":"0.25rem","color-scheme":"dark",default:!1,prefersdark:!1};var Fg=(e=>(e.IPSB="ip.sb",e.IPWHOIS="ipwho.is",e.IPAPI="ipapi.is",e))(Fg||{});const mge="https://testingcf.jsdelivr.net/gh/P3TERX/GeoLite.mmdb@download/GeoLite2-Country.mmdb",yge="https://testingcf.jsdelivr.net/gh/P3TERX/GeoLite.mmdb@download/GeoLite2-ASN.mmdb";var ot=(e=>(e.general="generalSettings",e.backend="backendSettings",e.proxies="proxySettings",e.connections="connectionSettings",e.overview="overviewSettings",e))(ot||{}),Pf=(e=>(e.ChartsCard="ChartsCard",e.NetworkCard="NetworkCard",e.ProviderTrafficOverview="ProviderTrafficOverview",e.TopologyCharts="TopologyCharts",e.ConnectionHistory="ConnectionHistory",e.RuleHitCountCard="RuleHitCountCard",e))(Pf||{}),Vh=(e=>(e.Meta="meta",e.Alpha="alpha",e.Smart="smart",e))(Vh||{});const uX={meta:{url:"https://github.com/metacubex/mihomo",check_update_url:"https://api.github.com/repos/MetaCubeX/mihomo/releases/latest"},alpha:{url:"https://github.com/metacubex/mihomo",check_update_url:"https://api.github.com/repos/MetaCubeX/mihomo/releases/tags/Prerelease-Alpha"},smart:{url:"https://github.com/vernesong/mihomo",check_update_url:"https://api.github.com/repos/vernesong/mihomo/releases/tags/Prerelease-Alpha"}},Kp=[{key:ot.backend,label:"backendSettings",items:[{key:`${ot.backend}.backendSwitch`,label:"backend"},{key:`${ot.backend}.actions`,label:"actions"},{key:`${ot.backend}.dnsQuery`,label:"DNSQuery"},{key:`${ot.backend}.ports`,label:"ports"},{key:`${ot.backend}.tunMode`,label:"tunMode"},{key:`${ot.backend}.allowLan`,label:"allowLan"},{key:`${ot.backend}.checkCoreUpgrade`,label:"checkCoreUpgrade"},{key:`${ot.backend}.autoUpgradeCore`,label:"autoUpgradeCore"}]},{key:ot.general,label:"zashboardSettings",items:[{key:`${ot.general}.zashboardSettings.actions`,label:"actions"},{key:`${ot.general}.zashboardSettings.autoSwitchTheme`,label:"autoSwitchTheme"},{key:`${ot.general}.zashboardSettings.defaultTheme`,label:"defaultTheme"},{key:`${ot.general}.zashboardSettings.darkTheme`,label:"darkTheme"},{key:`${ot.general}.zashboardSettings.customBackgroundURL`,label:"customBackgroundURL"},{key:`${ot.general}.zashboardSettings.transparent`,label:"transparent"},{key:`${ot.general}.zashboardSettings.blurIntensity`,label:"blurIntensity"},{key:`${ot.general}.zashboardSettings.fonts`,label:"fonts"},{key:`${ot.general}.zashboardSettings.emoji`,label:"emoji"},{key:`${ot.general}.zashboardSettings.language`,label:"language"},{key:`${ot.general}.zashboardSettings.autoUpgradeDashboard`,label:"autoUpgradeDashboard"},{key:`${ot.general}.autoDisconnectIdleUDP`,label:"autoDisconnectIdleUDP"},{key:`${ot.general}.autoDisconnectIdleUDPTime`,label:"autoDisconnectIdleUDPTime"},{key:`${ot.general}.IPInfoAPI`,label:"IPInfoAPI"},{key:`${ot.general}.geoipCountryDatabaseURL`,label:"geoipCountryDatabaseURL"},{key:`${ot.general}.geoipASNDatabaseURL`,label:"geoipASNDatabaseURL"},{key:`${ot.general}.scrollAnimationEffect`,label:"scrollAnimationEffect"},{key:`${ot.general}.swipeInPages`,label:"swipeInPages"},{key:`${ot.general}.swipeInTabs`,label:"swipeInTabs"},{key:`${ot.general}.disablePullToRefresh`,label:"disablePullToRefresh"},{key:`${ot.general}.shortcuts`,label:"keyboardShortcuts"},{key:`${ot.general}.displayAllFeatures`,label:"displayAllFeatures"}]},{key:ot.overview,label:"overviewSettings",items:[{key:`${ot.overview}.overviewCard`,label:"chartsCard"},{key:`${ot.overview}.networkCard`,label:"networkCard"},{key:`${ot.overview}.splitOverviewPage`,label:"splitOverviewPage"},{key:`${ot.overview}.autoIPCheckWhenStart`,label:"autoIPCheckWhenStart"},{key:`${ot.overview}.autoConnectionCheckWhenStart`,label:"autoConnectionCheckWhenStart"},{key:`${ot.overview}.showStatisticsWhenSidebarCollapsed`,label:"showStatisticsWhenSidebarCollapsed"},{key:`${ot.overview}.numberOfChartsInSidebar`,label:"numberOfChartsInSidebar"}]},{key:ot.proxies,label:"proxySettings",items:[{key:`${ot.proxies}.speedtestMode`,label:"speedtestMode"},{key:`${ot.proxies}.speedtestUrl`,label:"speedtestUrl"},{key:`${ot.proxies}.speedtestTimeout`,label:"speedtestTimeout"},{key:`${ot.proxies}.lowLatency`,label:"lowLatencyDesc"},{key:`${ot.proxies}.mediumLatency`,label:"mediumLatencyDesc"},{key:`${ot.proxies}.ipv6Test`,label:"ipv6Test"},{key:`${ot.proxies}.independentLatencyTest`,label:"independentLatencyTest"},{key:`${ot.proxies}.groupTestUrls`,label:"groupTestUrls"},{key:`${ot.proxies}.proxyFolderMode`,label:"proxyFolderMode"},{key:`${ot.proxies}.twoColumnProxyGroup`,label:"twoColumnProxyGroup"},{key:`${ot.proxies}.truncateProxyName`,label:"truncateProxyName"},{key:`${ot.proxies}.displayGlobalByMode`,label:"displayGlobalByMode"},{key:`${ot.proxies}.customGlobalNode`,label:"customGlobalNode"},{key:`${ot.proxies}.proxyPreviewType`,label:"proxyPreviewType"},{key:`${ot.proxies}.proxyCardSize`,label:"proxyCardSize"},{key:`${ot.proxies}.proxyGroupIconSize`,label:"proxyGroupIconSize"},{key:`${ot.proxies}.proxyGroupIconMargin`,label:"proxyGroupIconMargin"},{key:`${ot.proxies}.iconSettings`,label:"icon"}]},{key:ot.connections,label:"connectionSettings",items:[{key:`${ot.connections}.connectionStyle`,label:"connectionStyle"},{key:`${ot.connections}.proxyChainDirection`,label:"proxyChainDirection"},{key:`${ot.connections}.tableWidthMode`,label:"tableWidthMode"},{key:`${ot.connections}.tableSize`,label:"tableSize"},{key:`${ot.connections}.sourceIPLabels`,label:"sourceIPLabels"}]}];function cX(e){const t=Kp.find(n=>n.key===e);return t?t.items.map(n=>n.key):[]}function bge(e){const t=Kp.find(n=>n.key===e);return t?[t.key,...t.items.map(n=>n.key)]:[]}function _ge(){return Kp.flatMap(e=>bge(e.key))}const U_=G_(ot.general),Th=G_(ot.overview),Sge=G_(ot.backend),vM=G_(ot.proxies),wge=G_(ot.connections);function G_(e){const t=Kp.find(n=>n.key===e);return Object.fromEntries((t?.items??[]).map(n=>[n.label,n.key]))}function xge(e,t,n={}){let r,i,o,a=!0;const s=()=>{a=!0,o()};et(e,s,{flush:"sync",...n});const l=typeof t=="function"?t:t.get,u=typeof t=="function"?void 0:t.set,c=hI((f,h)=>(i=f,o=h,{get(){return a&&(r=l(r),a=!1),i(),r},set(d){u?.(d)}}));return c.trigger=s,c}function H_(e,t){return A_()?(R_(e,t),!0):!1}const RR=new WeakMap,Tge=(...e)=>{var t;const n=e[0],r=(t=vi())===null||t===void 0?void 0:t.proxy,i=r??A_();if(i==null&&!ZN())throw new Error("injectLocal must be called in setup");return i&&RR.has(i)&&n in RR.get(i)?RR.get(i)[n]:Zo(...e)},xI=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const fX=e=>e!=null,Ege=Object.prototype.toString,Cge=e=>Ege.call(e)==="[object Object]",uu=()=>{};function dX(...e){if(e.length!==1)return XN(...e);const t=e[0];return typeof t=="function"?nm(hI(()=>({get:t,set:uu}))):me(t)}function gM(e,t){function n(...r){return new Promise((i,o)=>{Promise.resolve(e(()=>t.apply(this,r),{fn:t,thisArg:this,args:r})).then(i).catch(o)})}return n}const hX=e=>e();function pX(e,t={}){let n,r,i=uu;const o=l=>{clearTimeout(l),i(),i=uu};let a;return l=>{const u=lr(e),c=lr(t.maxWait);return n&&o(n),u<=0||c!==void 0&&c<=0?(r&&(o(r),r=void 0),Promise.resolve(l())):new Promise((f,h)=>{i=t.rejectOnCancel?h:f,a=l,c&&!r&&(r=setTimeout(()=>{n&&o(n),r=void 0,f(a())},c)),n=setTimeout(()=>{r&&o(r),r=void 0,f(l())},u)})}}function Ige(...e){let t=0,n,r=!0,i=uu,o,a,s,l,u;!st(e[0])&&typeof e[0]=="object"?{delay:a,trailing:s=!0,leading:l=!0,rejectOnCancel:u=!1}=e[0]:[a,s=!0,l=!0,u=!1]=e;const c=()=>{n&&(clearTimeout(n),n=void 0,i(),i=uu)};return h=>{const d=lr(a),p=Date.now()-t,v=()=>o=h();return c(),d<=0?(t=Date.now(),v()):(p>d?(t=Date.now(),(l||!r)&&v()):s&&(o=new Promise((y,m)=>{i=u?m:y,n=setTimeout(()=>{t=Date.now(),r=!0,y(v()),c()},Math.max(0,d-p))})),!l&&!n&&(n=setTimeout(()=>r=!0,d)),r=!1,o)}}function Age(e=hX,t={}){const{initialState:n="active"}=t,r=dX(n==="active");function i(){r.value=!1}function o(){r.value=!0}return{isActive:Pg(r),pause:i,resume:o,eventFilter:(...s)=>{r.value&&e(...s)}}}function Rge(e){let t;function n(){return t||(t=e()),t}return n.reset=async()=>{const r=t;t=void 0,r&&await r},n}function SV(e){return e.endsWith("rem")?Number.parseFloat(e)*16:Number.parseFloat(e)}function $g(e){return Array.isArray(e)?e:[e]}function vX(e){return vi()}function kge(e,t=200,n={}){return gM(pX(t,n),e)}function Pge(e,t=200,n=!1,r=!0,i=!1){return gM(Ige(t,n,r,i),e)}function gX(e,t,n={}){const{eventFilter:r=hX,...i}=n;return et(e,gM(r,t),i)}function Dge(e,t,n={}){const{eventFilter:r,initialState:i="active",...o}=n,{eventFilter:a,pause:s,resume:l,isActive:u}=Age(r,{initialState:i});return{stop:gX(e,t,{...o,eventFilter:a}),pause:s,resume:l,isActive:u}}function W_(e,t=!0,n){vX()?Sr(e,n):t?e():Tr(e)}function Oge(e,t){vX()&&Do(e,t)}function Lge(e,t,n={}){const{immediate:r=!0,immediateCallback:i=!1}=n,o=mn(!1);let a;function s(){a&&(clearTimeout(a),a=void 0)}function l(){o.value=!1,s()}function u(...c){i&&e(),s(),o.value=!0,a=setTimeout(()=>{o.value=!1,a=void 0,e(...c)},lr(t))}return r&&(o.value=!0,xI&&u()),H_(l),{isPending:Pg(o),start:u,stop:l}}function Nge(e,t,n={}){const{debounce:r=0,maxWait:i=void 0,...o}=n;return gX(e,t,{...o,eventFilter:pX(r,{maxWait:i})})}function Mge(e,t,n){return et(e,t,{...n,immediate:!0})}function mX(e,t,n){return et(e,t,{...n,once:!0})}const Sa=xI?window:void 0,yX=xI?window.document:void 0,bX=xI?window.navigator:void 0;function wa(e){var t;const n=lr(e);return(t=n?.$el)!==null&&t!==void 0?t:n}function Jo(...e){const t=(r,i,o,a)=>(r.addEventListener(i,o,a),()=>r.removeEventListener(i,o,a)),n=ae(()=>{const r=$g(lr(e[0])).filter(i=>i!=null);return r.every(i=>typeof i!="string")?r:void 0});return Mge(()=>{var r,i;return[(r=(i=n.value)===null||i===void 0?void 0:i.map(o=>wa(o)))!==null&&r!==void 0?r:[Sa].filter(o=>o!=null),$g(lr(n.value?e[1]:e[0])),$g(R(n.value?e[2]:e[1])),lr(n.value?e[3]:e[2])]},([r,i,o,a],s,l)=>{if(!r?.length||!i?.length||!o?.length)return;const u=Cge(a)?{...a}:a,c=r.flatMap(f=>i.flatMap(h=>o.map(d=>t(f,h,d,u))));l(()=>{c.forEach(f=>f())})},{flush:"post"})}function Fge(){const e=mn(!1),t=vi();return t&&Sr(()=>{e.value=!0},t),e}function sy(e){const t=Fge();return ae(()=>(t.value,!!e()))}function mM(e,t,n={}){const{window:r=Sa,...i}=n;let o;const a=sy(()=>r&&"MutationObserver"in r),s=()=>{o&&(o.disconnect(),o=void 0)},l=et(ae(()=>{const f=$g(lr(e)).map(wa).filter(fX);return new Set(f)}),f=>{s(),a.value&&f.size&&(o=new MutationObserver(t),f.forEach(h=>o.observe(h,i)))},{immediate:!0,flush:"post"}),u=()=>o?.takeRecords(),c=()=>{l(),s()};return H_(c),{isSupported:a,stop:c,takeRecords:u}}const $ge=Symbol("vueuse-ssr-width");function Bge(){const e=ZN()?Tge($ge,null):null;return typeof e=="number"?e:void 0}function TI(e,t={}){const{window:n=Sa,ssrWidth:r=Bge()}=t,i=sy(()=>n&&"matchMedia"in n&&typeof n.matchMedia=="function"),o=mn(typeof r=="number"),a=mn(),s=mn(!1),l=u=>{s.value=u.matches};return vI(()=>{if(o.value){o.value=!i.value,s.value=lr(e).split(",").some(u=>{const c=u.includes("not all"),f=u.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/),h=u.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);let d=!!(f||h);return f&&d&&(d=r>=SV(f[1])),h&&d&&(d=r<=SV(h[1])),c?!d:d});return}i.value&&(a.value=n.matchMedia(lr(e)),s.value=a.value.matches)}),Jo(a,"change",l,{passive:!0}),ae(()=>s.value)}function wV(e,t={}){const{controls:n=!1,navigator:r=bX}=t,i=sy(()=>r&&"permissions"in r),o=mn(),a=typeof e=="string"?{name:e}:e,s=mn(),l=()=>{var c,f;s.value=(c=(f=o.value)===null||f===void 0?void 0:f.state)!==null&&c!==void 0?c:"prompt"};Jo(o,"change",l,{passive:!0});const u=Rge(async()=>{if(i.value){if(!o.value)try{o.value=await r.permissions.query(a)}catch{o.value=void 0}finally{l()}if(n)return In(o.value)}});return u(),n?{state:s,isSupported:i,query:u}:s}function Kqe(e={}){const{navigator:t=bX,read:n=!1,source:r,copiedDuring:i=1500,legacy:o=!1}=e,a=sy(()=>t&&"clipboard"in t),s=wV("clipboard-read"),l=wV("clipboard-write"),u=ae(()=>a.value||o),c=mn(""),f=mn(!1),h=mn(!1),d=Lge(()=>f.value=!1,i,{immediate:!1});let p=0;async function v(){let x=!(a.value&&w(s.value));if(!x)try{c.value=await t.clipboard.readText()}catch{x=!0}x&&(c.value=S())}u.value&&n&&Jo(["copy","cut"],v,{passive:!0});async function y(x){const T=x??lr(r);if(u.value&&T!=null){h.value=!0;let C=!(a.value&&w(l.value));if(!C)try{const P=m(T);await t.clipboard.write([P])}catch{C=!0}if(C)if(typeof T=="string")c.value=T,b(T);else{const P=++p,k=await T();k!=null&&P===p&&(c.value=k,b(k))}f.value=!0,d.start(),h.value=!1}}function m(x){return typeof x=="string"?(c.value=x,new ClipboardItem({"text/plain":x})):new ClipboardItem({"text/plain":x().then((T="")=>(c.value=T,new Blob([T],{type:"text/plain"})))})}function b(x){const T=document.createElement("textarea");T.value=x,T.style.position="absolute",T.style.opacity="0",T.setAttribute("readonly",""),document.body.appendChild(T),T.select(),document.execCommand("copy"),T.remove()}function S(){var x,T,C;return(x=(T=document)===null||T===void 0||(C=T.getSelection)===null||C===void 0||(C=C.call(T))===null||C===void 0?void 0:C.toString())!==null&&x!==void 0?x:""}function w(x){return x==="granted"||x==="prompt"}return{copyPending:Pg(h),isSupported:u,text:Pg(c),copied:Pg(f),copy:y}}const Tw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ew="__vueuse_ssr_handlers__",Vge=Uge();function Uge(){return Ew in Tw||(Tw[Ew]=Tw[Ew]||{}),Tw[Ew]}function Gge(e,t){return Vge[e]||t}function Hge(e){return e==null?"any":e instanceof Set?"set":e instanceof Map?"map":e instanceof Date?"date":typeof e=="boolean"?"boolean":typeof e=="string"?"string":typeof e=="object"?"object":Number.isNaN(e)?"any":"number"}const Wge={boolean:{read:e=>e==="true",write:e=>String(e)},object:{read:e=>JSON.parse(e),write:e=>JSON.stringify(e)},number:{read:e=>Number.parseFloat(e),write:e=>String(e)},any:{read:e=>e,write:e=>String(e)},string:{read:e=>e,write:e=>String(e)},map:{read:e=>new Map(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e.entries()))},set:{read:e=>new Set(JSON.parse(e)),write:e=>JSON.stringify(Array.from(e))},date:{read:e=>new Date(e),write:e=>e.toISOString()}},xV="vueuse-storage";function Qe(e,t,n,r={}){var i;const{flush:o="pre",deep:a=!0,listenToStorageChanges:s=!0,writeDefaults:l=!0,mergeDefaults:u=!1,shallow:c,window:f=Sa,eventFilter:h,onError:d=U=>{console.error(U)},initOnMounted:p}=r,v=(c?mn:me)(typeof t=="function"?t():t),y=ae(()=>lr(e));if(!n)try{n=Gge("getDefaultStorage",()=>Sa?.localStorage)()}catch(U){d(U)}if(!n)return v;const m=lr(t),b=Hge(m),S=(i=r.serializer)!==null&&i!==void 0?i:Wge[b],{pause:w,resume:x}=Dge(v,U=>L(U),{flush:o,deep:a,eventFilter:h});et(y,()=>M(),{flush:o});let T=!1;const C=U=>{p&&!T||M(U)},P=U=>{p&&!T||F(U)};f&&s&&(n instanceof Storage?Jo(f,"storage",C,{passive:!0}):Jo(f,xV,P)),p?W_(()=>{T=!0,M()}):M();function k(U,X){if(f){const $={key:y.value,oldValue:U,newValue:X,storageArea:n};f.dispatchEvent(n instanceof Storage?new StorageEvent("storage",$):new CustomEvent(xV,{detail:$}))}}function L(U){try{const X=n.getItem(y.value);if(U==null)k(X,null),n.removeItem(y.value);else{const $=S.write(U);X!==$&&(n.setItem(y.value,$),k(X,$))}}catch(X){d(X)}}function O(U){const X=U?U.newValue:n.getItem(y.value);if(X==null)return l&&m!=null&&n.setItem(y.value,S.write(m)),m;if(!U&&u){const $=S.read(X);return typeof u=="function"?u($,m):b==="object"&&!Array.isArray($)?{...m,...$}:$}else return typeof X!="string"?X:S.read(X)}function M(U){if(!(U&&U.storageArea!==n)){if(U&&U.key==null){v.value=m;return}if(!(U&&U.key!==y.value)){w();try{const X=S.write(v.value);(U===void 0||U?.newValue!==X)&&(v.value=O(U))}catch(X){d(X)}finally{U?Tr(x):x()}}}}function F(U){M(U.detail)}return v}function yM(e){const t=vi(),n=xge(()=>null,()=>t.proxy.$el);return O_(n.trigger),Sr(n.trigger),n}function zge(e={}){const{document:t=yX}=e;if(!t)return mn("visible");const n=mn(t.visibilityState);return Jo(t,"visibilitychange",()=>{n.value=t.visibilityState},{passive:!0}),n}function bM(e,t,n={}){const{window:r=Sa,...i}=n;let o;const a=sy(()=>r&&"ResizeObserver"in r),s=()=>{o&&(o.disconnect(),o=void 0)},l=et(ae(()=>{const c=lr(e);return Array.isArray(c)?c.map(f=>wa(f)):[wa(c)]}),c=>{if(s(),a.value&&r){o=new ResizeObserver(t);for(const f of c)f&&o.observe(f,i)}},{immediate:!0,flush:"post"}),u=()=>{s(),l()};return H_(u),{isSupported:a,stop:u}}function _X(e,t={}){const{reset:n=!0,windowResize:r=!0,windowScroll:i=!0,immediate:o=!0,updateTiming:a="sync"}=t,s=mn(0),l=mn(0),u=mn(0),c=mn(0),f=mn(0),h=mn(0),d=mn(0),p=mn(0);function v(){const m=wa(e);if(!m){n&&(s.value=0,l.value=0,u.value=0,c.value=0,f.value=0,h.value=0,d.value=0,p.value=0);return}const b=m.getBoundingClientRect();s.value=b.height,l.value=b.bottom,u.value=b.left,c.value=b.right,f.value=b.top,h.value=b.width,d.value=b.x,p.value=b.y}function y(){a==="sync"?v():a==="next-frame"&&requestAnimationFrame(()=>v())}return bM(e,y),et(()=>wa(e),m=>!m&&y()),mM(e,y,{attributeFilter:["style","class"]}),i&&Jo("scroll",y,{capture:!0,passive:!0}),r&&Jo("resize",y,{passive:!0}),W_(()=>{o&&y()}),{height:s,bottom:l,left:u,right:c,top:f,width:h,x:d,y:p,update:y}}function ku(e,t={width:0,height:0},n={}){const{window:r=Sa,box:i="content-box"}=n,o=ae(()=>{var f;return(f=wa(e))===null||f===void 0||(f=f.namespaceURI)===null||f===void 0?void 0:f.includes("svg")}),a=mn(t.width),s=mn(t.height),{stop:l}=bM(e,([f])=>{const h=i==="border-box"?f.borderBoxSize:i==="content-box"?f.contentBoxSize:f.devicePixelContentBoxSize;if(r&&o.value){const d=wa(e);if(d){const p=d.getBoundingClientRect();a.value=p.width,s.value=p.height}}else if(h){const d=$g(h);a.value=d.reduce((p,{inlineSize:v})=>p+v,0),s.value=d.reduce((p,{blockSize:v})=>p+v,0)}else a.value=f.contentRect.width,s.value=f.contentRect.height},n);W_(()=>{const f=wa(e);f&&(a.value="offsetWidth"in f?f.offsetWidth:t.width,s.value="offsetHeight"in f?f.offsetHeight:t.height)});const u=et(()=>wa(e),f=>{a.value=f?t.width:0,s.value=f?t.height:0});function c(){l(),u()}return{width:a,height:s,stop:c}}function Yge(e,t,n={}){const{root:r,rootMargin:i,threshold:o=0,window:a=Sa,immediate:s=!0}=n,l=sy(()=>a&&"IntersectionObserver"in a),u=ae(()=>$g(lr(e)).map(wa).filter(fX));let c=uu;const f=mn(s),h=l.value?et(()=>[u.value,wa(r),lr(i),f.value],([p,v,y])=>{if(c(),!f.value||!p.length)return;const m=new IntersectionObserver(t,{root:wa(v),rootMargin:y,threshold:o});p.forEach(b=>b&&m.observe(b)),c=()=>{m.disconnect(),c=uu}},{immediate:s,flush:"post"}):uu,d=()=>{c(),h(),f.value=!1};return H_(d),{isSupported:l,isActive:f,pause(){c(),f.value=!1},resume(){f.value=!0},stop:d}}function SX(e,t={}){const{window:n=Sa,scrollTarget:r,threshold:i=0,rootMargin:o,once:a=!1,initialValue:s=!1}=t,l=mn(s),u=Yge(e,c=>{let f=l.value,h=0;for(const d of c)d.time>=h&&(h=d.time,f=d.isIntersecting);l.value=f,a&&mX(l,()=>{u.stop()})},{root:r,window:n,threshold:i,rootMargin:o});return t.controls?{...u,isVisible:l}:l}function jge(e){return typeof Window<"u"&&e instanceof Window?e.document.documentElement:typeof Document<"u"&&e instanceof Document?e.documentElement:e}const TV=1;function Xge(e,t={}){const{throttle:n=0,idle:r=200,onStop:i=uu,onScroll:o=uu,offset:a={left:0,right:0,top:0,bottom:0},observe:s={mutation:!1},eventListenerOptions:l={capture:!1,passive:!0},behavior:u="auto",window:c=Sa,onError:f=k=>{console.error(k)}}=t,h=typeof s=="boolean"?{mutation:s}:s,d=mn(0),p=mn(0),v=ae({get(){return d.value},set(k){m(k,void 0)}}),y=ae({get(){return p.value},set(k){m(void 0,k)}});function m(k,L){var O,M,F,U;if(!c)return;const X=lr(e);if(!X)return;(O=X instanceof Document?c.document.body:X)===null||O===void 0||O.scrollTo({top:(M=lr(L))!==null&&M!==void 0?M:y.value,left:(F=lr(k))!==null&&F!==void 0?F:v.value,behavior:lr(u)});const $=(X==null||(U=X.document)===null||U===void 0?void 0:U.documentElement)||X?.documentElement||X;v!=null&&(d.value=$.scrollLeft),y!=null&&(p.value=$.scrollTop)}const b=mn(!1),S=io({left:!0,right:!1,top:!0,bottom:!1}),w=io({left:!1,right:!1,top:!1,bottom:!1}),x=k=>{b.value&&(b.value=!1,w.left=!1,w.right=!1,w.top=!1,w.bottom=!1,i(k))},T=kge(x,n+r),C=k=>{var L;if(!c)return;const O=(k==null||(L=k.document)===null||L===void 0?void 0:L.documentElement)||k?.documentElement||wa(k),{display:M,flexDirection:F,direction:U}=c.getComputedStyle(O),X=U==="rtl"?-1:1,$=O.scrollLeft;w.left=$d.value;const W=Math.abs($*X)<=(a.left||0),G=Math.abs($*X)+O.clientWidth>=O.scrollWidth-(a.right||0)-TV;M==="flex"&&F==="row-reverse"?(S.left=G,S.right=W):(S.left=W,S.right=G),d.value=$;let Q=O.scrollTop;k===c.document&&!Q&&(Q=c.document.body.scrollTop),w.top=Qp.value;const ne=Math.abs(Q)<=(a.top||0),re=Math.abs(Q)+O.clientHeight>=O.scrollHeight-(a.bottom||0)-TV;M==="flex"&&F==="column-reverse"?(S.top=re,S.bottom=ne):(S.top=ne,S.bottom=re),p.value=Q},P=k=>{var L;c&&(C((L=k.target.documentElement)!==null&&L!==void 0?L:k.target),b.value=!0,T(k),o(k))};return Jo(e,"scroll",n?Pge(P,n,!0,!1):P,l),W_(()=>{try{const k=lr(e);if(!k)return;C(k)}catch(k){f(k)}}),h?.mutation&&e!=null&&e!==c&&e!==document&&mM(e,()=>{const k=lr(e);k&&C(k)},{attributes:!0,childList:!0,subtree:!0}),Jo(e,"scrollend",x,l),{x:v,y,isScrolling:b,arrivedState:S,directions:w,measure(){const k=lr(e);c&&k&&C(k)}}}function Kge(e,t,n={}){var r;const{direction:i="bottom",interval:o=100,canLoadMore:a=()=>!0}=n,s=io(Xge(e,{...n,offset:{[i]:(r=n.distance)!==null&&r!==void 0?r:0,...n.offset}})),l=mn(),u=ae(()=>!!l.value),c=ae(()=>jge(lr(e))),f=SX(c),h=ae(()=>c.value?a(c.value):!1);function d(){if(s.measure(),!c.value||!f.value||!h.value||l.value)return;const{scrollHeight:p,clientHeight:v,scrollWidth:y,clientWidth:m}=c.value,b=i==="bottom"||i==="top"?p<=v:y<=m;(s.arrivedState[i]||b)&&(l.value=Promise.all([t(s),new Promise(S=>setTimeout(S,o))]).finally(()=>{l.value=null,Tr(()=>d())}))}return Oge(et(()=>[s.arrivedState[i],f.value,h.value],d,{immediate:!0,flush:"post"})),{isLoading:u,reset(){Tr(()=>d())}}}function EI(e,t,n={}){const{window:r=Sa}=n;return Qe(e,t,r?.sessionStorage,n)}function Zge(e,t={}){const{threshold:n=50,onSwipe:r,onSwipeEnd:i,onSwipeStart:o,passive:a=!0}=t,s=io({x:0,y:0}),l=io({x:0,y:0}),u=ae(()=>s.x-l.x),c=ae(()=>s.y-l.y),{max:f,abs:h}=Math,d=ae(()=>f(h(u.value),h(c.value))>=n),p=mn(!1),v=ae(()=>d.value?h(u.value)>h(c.value)?u.value>0?"left":"right":c.value>0?"up":"down":"none"),y=C=>[C.touches[0].clientX,C.touches[0].clientY],m=(C,P)=>{s.x=C,s.y=P},b=(C,P)=>{l.x=C,l.y=P},S={passive:a,capture:!a},w=C=>{p.value&&i?.(C,v.value),p.value=!1},x=[Jo(e,"touchstart",C=>{if(C.touches.length!==1)return;const[P,k]=y(C);m(P,k),b(P,k),o?.(C)},S),Jo(e,"touchmove",C=>{if(C.touches.length!==1)return;const[P,k]=y(C);b(P,k),S.capture&&!S.passive&&Math.abs(u.value)>Math.abs(c.value)&&C.preventDefault(),!p.value&&d.value&&(p.value=!0),p.value&&r?.(C)},S),Jo(e,["touchend","touchcancel"],w,S)];return{isSwiping:p,direction:v,coordsStart:s,coordsEnd:l,lengthX:u,lengthY:c,stop:()=>x.forEach(C=>C())}}function Jge(e=null,t={}){var n,r;const{document:i=yX,restoreOnUnmount:o=f=>f}=t,a=(n=i?.title)!==null&&n!==void 0?n:"",s=dX((r=e??i?.title)!==null&&r!==void 0?r:null),l=!!(e&&typeof e=="function");function u(f){if(!("titleTemplate"in t))return f;const h=t.titleTemplate||"%s";return typeof h=="function"?h(f):lr(h).replace(/%s/g,f)}if(et(s,(f,h)=>{f!==h&&i&&(i.title=u(f??""))},{immediate:!0}),t.observe&&!t.titleTemplate&&i&&!l){var c;mM((c=i.head)===null||c===void 0?void 0:c.querySelector("title"),()=>{i&&i.title!==s.value&&(s.value=u(i.title))},{childList:!0})}return H_(()=>{if(o){const f=o(a,s.value||"");f!=null&&i&&(i.title=f)}}),s}function Qge(e={}){const{window:t=Sa,initialWidth:n=Number.POSITIVE_INFINITY,initialHeight:r=Number.POSITIVE_INFINITY,listenOrientation:i=!0,includeScrollbar:o=!0,type:a="inner"}=e,s=mn(n),l=mn(r),u=()=>{if(t)if(a==="outer")s.value=t.outerWidth,l.value=t.outerHeight;else if(a==="visual"&&t.visualViewport){const{width:f,height:h,scale:d}=t.visualViewport;s.value=Math.round(f*d),l.value=Math.round(h*d)}else o?(s.value=t.innerWidth,l.value=t.innerHeight):(s.value=t.document.documentElement.clientWidth,l.value=t.document.documentElement.clientHeight)};u(),W_(u);const c={passive:!0};return Jo("resize",u,c),t&&a==="visual"&&t.visualViewport&&Jo(t.visualViewport,"resize",u,c),i&&et(TI("(orientation: portrait)"),()=>u()),{width:s,height:l}}var Cw=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ly(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function CI(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){var i=!1;try{i=this instanceof r}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var qx={exports:{}},qge=qx.exports,EV;function II(){return EV||(EV=1,(function(e,t){(function(n,r){e.exports=r()})(qge,(function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",u="day",c="week",f="month",h="quarter",d="year",p="date",v="Invalid Date",y=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,m=/\[([^\]]+)]|YYYY|YY|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,b={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(U){var X=["th","st","nd","rd"],$=U%100;return"["+U+(X[($-20)%10]||X[$]||X[0])+"]"}},S=function(U,X,$){var W=String(U);return!W||W.length>=X?U:""+Array(X+1-W.length).join($)+U},w={s:S,z:function(U){var X=-U.utcOffset(),$=Math.abs(X),W=Math.floor($/60),G=$%60;return(X<=0?"+":"-")+S(W,2,"0")+":"+S(G,2,"0")},m:function U(X,$){if(X.date()<$.date())return-U($,X);var W=12*($.year()-X.year())+($.month()-X.month()),G=X.clone().add(W,f),Q=$-G<0,ne=X.clone().add(W+(Q?-1:1),f);return+(-(W+($-G)/(Q?G-ne:ne-G))||0)},a:function(U){return U<0?Math.ceil(U)||0:Math.floor(U)},p:function(U){return{M:f,y:d,w:c,d:u,D:p,h:l,m:s,s:a,ms:o,Q:h}[U]||String(U||"").toLowerCase().replace(/s$/,"")},u:function(U){return U===void 0}},x="en",T={};T[x]=b;var C="$isDayjsObject",P=function(U){return U instanceof M||!(!U||!U[C])},k=function U(X,$,W){var G;if(!X)return x;if(typeof X=="string"){var Q=X.toLowerCase();T[Q]&&(G=Q),$&&(T[Q]=$,G=Q);var ne=X.split("-");if(!G&&ne.length>1)return U(ne[0])}else{var re=X.name;T[re]=X,G=re}return!W&&G&&(x=G),G||!W&&x},L=function(U,X){if(P(U))return U.clone();var $=typeof X=="object"?X:{};return $.date=U,$.args=arguments,new M($)},O=w;O.l=k,O.i=P,O.w=function(U,X){return L(U,{locale:X.$L,utc:X.$u,x:X.$x,$offset:X.$offset})};var M=(function(){function U($){this.$L=k($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[C]=!0}var X=U.prototype;return X.parse=function($){this.$d=(function(W){var G=W.date,Q=W.utc;if(G===null)return new Date(NaN);if(O.u(G))return new Date;if(G instanceof Date)return new Date(G);if(typeof G=="string"&&!/Z$/i.test(G)){var ne=G.match(y);if(ne){var re=ne[2]-1||0,pe=(ne[7]||"0").substring(0,3);return Q?new Date(Date.UTC(ne[1],re,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,pe)):new Date(ne[1],re,ne[3]||1,ne[4]||0,ne[5]||0,ne[6]||0,pe)}}return new Date(G)})($),this.init()},X.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},X.$utils=function(){return O},X.isValid=function(){return this.$d.toString()!==v},X.isSame=function($,W){var G=L($);return this.startOf(W)<=G&&G<=this.endOf(W)},X.isAfter=function($,W){return L($){let r=e;return typeof t=="string"||Array.isArray(t)?r=e.toLocaleString(t,n):(t===!0||n!==void 0)&&(r=e.toLocaleString(void 0,n)),r},wX=e=>{if(typeof e=="number")return Math.log10(e);const t=e.toString(10);return t.length+Math.log10(`0.${t.slice(0,15)}`)},ome=e=>typeof e=="number"?Math.log(e):wX(e)*Math.log(10),ame=(e,t)=>{if(typeof e=="number")return e/t;const n=e/BigInt(t),r=e%BigInt(t);return Number(n)+Number(r)/t},IV=(e,t)=>{if(t===void 0)return e;if(typeof t!="number"||!Number.isSafeInteger(t)||t<0)throw new TypeError(`Expected fixedWidth to be a non-negative integer, got ${typeof t}: ${t}`);return t===0?e:e.length{const{minimumFractionDigits:t,maximumFractionDigits:n}=e;if(!(t===void 0&&n===void 0))return{...t!==void 0&&{minimumFractionDigits:t},...n!==void 0&&{maximumFractionDigits:n},roundingMode:"trunc"}};function lme(e,t){if(typeof e!="bigint"&&!Number.isFinite(e))throw new TypeError(`Expected a finite number, got ${typeof e}: ${e}`);t={bits:!1,binary:!1,space:!0,nonBreakingSpace:!1,...t};const n=t.bits?t.binary?ime:rme:t.binary?nme:tme,r=t.space?t.nonBreakingSpace?" ":" ":"",i=typeof e=="number"?e===0:e===0n;if(t.signed&&i){const u=` 0${r}${n[0]}`;return IV(u,t.fixedWidth)}const o=e<0,a=o?"-":t.signed?"+":"";o&&(e=-e);const s=sme(t);let l;if(e<1){const u=CV(e,t.locale,s);l=a+u+r+n[0]}else{const u=Math.min(Math.floor(t.binary?ome(e)/Math.log(1024):wX(e)/3),n.length-1);if(e=ame(e,(t.binary?1024:1e3)**u),!s){const h=Math.max(3,Math.floor(e).toString().length);e=e.toPrecision(h)}const c=CV(Number(e),t.locale,s),f=n[u];l=a+c+r+f}return IV(l,t.fixedWidth)}const xX=TI("(prefers-color-scheme: dark)"),ur=TI("(max-width: 768px)"),ume=window.matchMedia("(display-mode: standalone)").matches||navigator.standalone,yn=(e,t)=>lme(e,{binary:!1,...t}),_M=e=>Br(e).fromNow(),TX=()=>{const e={};for(const t in localStorage)t.startsWith("config/")&&(e[t]=localStorage.getItem(t));return e},EX=e=>{for(const t in e)t.startsWith("config/")&&localStorage.setItem(t,e[t])},AV=()=>{const e=TX(),t=new Blob([JSON.stringify(e,null,2)],{type:"application/json"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download="zashboard-settings",r.click(),URL.revokeObjectURL(n)},cme=()=>{Object.keys(localStorage).filter(t=>t.startsWith("config/")).forEach(t=>localStorage.removeItem(t)),window.location.reload()},SM=e=>`${e.protocol}://${e.host}:${e.port}${e.secondaryPath||""}`,z_=e=>e.type!=="singbox"||!e.host?"":`${e.protocol}://${e.host}:${e.port}`,AI=e=>e.type==="singbox"&&e.password||"",$c=e=>e.label||`${e.host}:${e.port}`,wM=e=>e===ay.LARGE?HD.LARGE:HD.SMALL,xM="proxies-scrollable-parent",RV=e=>{const t=TM(e);if(!t)return;const n=e.getBoundingClientRect(),r=t.getBoundingClientRect();if(n.top>=r.top&&n.bottom<=r.bottom)return;const i=t.offsetTop,a=e.offsetTop-i-t.clientHeight/2+e.clientHeight/2;t.scrollTo({top:a,behavior:"smooth"})},TM=e=>{const t=e?.parentElement;return t?.classList.contains(xM)&&t.scrollHeight>t.clientHeight?t:t?TM(t):null},CX=()=>{const e=new URLSearchParams(window.location.search||location.hash.match(/\?.*$/)?.[0]?.replace("?",""));return e.has("hostname")?{type:e.get("type")==="singbox"?"singbox":"clash",protocol:e.get("http")?"http":e.get("https")?"https":window.location.protocol.replace(":",""),secondaryPath:e.get("secondaryPath")||"",host:e.get("hostname"),port:e.get("port"),password:e.get("secret")||"",label:e.get("label")||"",disableUpgradeCore:e.get("disableUpgradeCore")==="1"||e.get("disableUpgradeCore")==="core",disableTunMode:e.get("disableTunMode")==="1"||e.get("disableTunMode")==="tun"}:null},uy=(e,t)=>{if(typeof window>"u")return;const n=localStorage.getItem(e),r=localStorage.getItem(t);n!==null&&r===null&&localStorage.setItem(t,n),localStorage.removeItem(e)};uy("config/show-seleted-for-now-node","config/show-selected-for-now-node");uy("config/use-connecticon-card","config/use-connection-card");uy("config/connecticon-table-size","config/connection-table-size");uy("config/ipv6-map","cache/ipv6-map");uy("config/collapse-group-map","cache/collapse-group-map");uy("config/log-search-history","cache/log-search-history");const fme=()=>{if(typeof window>"u")return;const e="config/connection-display-style",t=localStorage.getItem(e),n="config/use-connection-card";if(t!==null)return;const r=localStorage.getItem(n);(r==="true"||r==="false")&&localStorage.setItem(e,r==="true"?Sc.CARD:Sc.TABLE),localStorage.removeItem(n)};fme();const xc=Qe("config/default-theme","light"),Jf=Qe("config/dark-theme","dark"),Mh=Qe("config/auto-theme",!0),ud=ae(()=>Mh.value&&xX.value?Jf.value:xc.value),lm=Qe("config/custom-themes",[]),IX=(e,t)=>e==="dark-apple"?"dark":[...S1,...lm.value.map(n=>n.name)].includes(e)?e:t;xc.value=IX(xc.value,"light");Jf.value=IX(Jf.value,"dark");const ru=Qe("config/language",Object.values(Yo).includes(navigator.language)?navigator.language:Yo.EN_US),kV=Qe("config/is-sidebar-collapsed",!0),bo=ae({get:()=>ur.value?!0:kV.value,set:e=>{kV.value=e}}),PV=Qe("config/font",go.MI_SANS),Tc=ae({get:()=>{const e="production";return Object.values(go).includes(e)?e:PV.value},set:e=>{PV.value=e}}),eT=Qe("config/emoji",pge?ap.TWEMOJI:ap.NOTO_COLOR_EMOJI),Go=Qe("config/custom-background-image",""),xb=Qe("config/dashboard-transparent",90),tT=Qe("config/auto-upgrade",!1),Eh=Qe("config/check-upgrade-core",!0),eb=Qe("config/auto-upgrade-core",!1),eg=Qe("config/swipe-in-pages",!0),nT=Qe("config/swipe-in-tabs",!1),Tb=Qe("config/disable-pull-to-refresh",!0),Eb=Qe("config/display-all-features",!1),Ec=Qe("config/blur-intensity",10),rT=Qe("config/scroll-animation-effect",!0),Bg=Qe("config/geoip-info-api",Fg.IPSB),Cb=Qe("config/geoip-country-database-url",mge),Ib=Qe("config/geoip-asn-database-url",yge),tg=Qe("config/auto-disconnect-idle-udp",!1),iT=Qe("config/auto-disconnect-idle-udp-time",300),Ch=Qe("config/keyboard-shortcuts",{}),tb=Qe("config/split-overview-page",!1),oT=Qe("config/auto-ip-check",!0),aT=Qe("config/auto-connection-check",!0),sT=Qe("config/show-statistics-when-sidebar-collapsed",!0),lT=Qe("config/number-of-charts-in-sidebar",2),dme=[{card:Pf.ChartsCard,visible:!0},{card:Pf.NetworkCard,visible:!0},{card:Pf.TopologyCharts,visible:!0},{card:Pf.ProviderTrafficOverview,visible:!0},{card:Pf.ConnectionHistory,visible:!0},{card:Pf.RuleHitCountCard,visible:!0}],um=Qe("config/overview-card-order",dme),hme=Object.values(Pf),pme=new Set(um.value.map(e=>e.card)),DV=hme.filter(e=>!pme.has(e));if(DV.length>0){const e=DV.map(t=>({card:t,visible:!0}));um.value=[...um.value,...e]}const ME=Qe("cache/collapse-group-map",{}),uT=Qe("cache/proxy-group-filter-map",{}),WD=Qe("config/show-selected-for-now-node",!1),Vg=Qe("config/two-columns",!0),cT=Qe("config/proxy-folder-mode-setting",lp.AUTO),fT=Qe("config/speedtest-url",aX),Uh=Qe("config/independent-latency-test",!1),kR=Qe("config/speedtest-timeout",5e3),PR=Qe("config/speedtest-mode",NE.DASHBOARD),vme=Qe("config/proxy-search-mode",sp.GROUP),gme=Qe("config/proxy-provider-search-mode",sp.GLOBAL),w1=Qe("config/proxy-sort-type",nu.DEFAULT),DR=Qe("config/automatic-disconnection",!0),dT=Qe("config/truncate-proxy-name",!0),zD=Qe("config/disable-proxies-page-text-select",!0),Ab=Qe("config/proxy-preview-type",b1.AUTO),YD=Qe("config/hide-unavailable-proxies",!1),cc=Qe("config/low-latency",400),Ql=Qe("config/medium-latency",800),hT=Qe("config/ipv6-test",!1),Uf=Qe("config/proxy-card-size",ay.LARGE),Ug=Qe("config/min-proxy-card-width",wM(Uf.value)),xp=Qe("config/manage-hidden-group-mode",!1),ng=Qe("config/display-global-by-mode",!1),Rb=Qe("config/custom-global-node-name",q0),pT=Qe("config/proxy-group-icon-size",24),vT=Qe("config/proxy-group-icon-margin",6),Yd=Qe("config/icon-reflect-list",[]),FE=Qe("config/group-proxies-by-provider",!1),jD=Qe("config/use-smart-group-sort",!1),Tf=Qe("config/group-test-urls",[]),kb=Qe("config/connection-display-style",Sc.AUTO),Ka=ae(()=>kb.value===Sc.CARD?!0:kb.value===Sc.TABLE?!1:ur.value),cu=Qe("config/proxy-chain-direction",Xp.NORMAL),Qf=Qe("config/show-full-proxy-chain",!0),gT=Qe("config/connection-table-size",_1.LARGE),mT=Qe("config/table-width-mode",wI.AUTO),Ya=Qe("config/connection-table-columns",[Se.Close,Se.Host,Se.Type,Se.Rule,Se.Chains,Se.DlSpeed,Se.UlSpeed,Se.Download,Se.Upload,Se.ConnectTime]),wi=Qe("config/connection-card-lines",lX),Ti=Qe("config/source-ip-label-list",[]),XD=Qe("config/display-now-node-in-rule",!0),KD=Qe("config/display-latency-in-rule",!0),ZD=Qe("config/disconnect-on-rule-disable",!0),JD=Qe("config/log-retention-limit",1e3),jd=Qe("cache/log-search-history",[]),Cc=Qe("config/hidden-settings-items",{}),x1=Qe("config/settings-menu-order",Kp.map(e=>e.key)),Iw=Qe("config/settings-page-two-columns",!0);function mme(e,t){typeof console<"u"&&(console.warn("[intlify] "+e),t&&console.warn(t.stack))}const $E=typeof window<"u",xd=(e,t=!1)=>t?Symbol.for(e):Symbol(e),yme=(e,t,n)=>bme({l:e,k:t,s:n}),bme=e=>JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029").replace(/\u0027/g,"\\u0027"),hi=e=>typeof e=="number"&&isFinite(e),AX=e=>CM(e)==="[object Date]",cm=e=>CM(e)==="[object RegExp]",RI=e=>Dn(e)&&Object.keys(e).length===0,pi=Object.assign,_me=Object.create,cr=(e=null)=>_me(e);let OV;const Gh=()=>OV||(OV=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:cr());function LV(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/").replace(/=/g,"=")}function Sme(e){return e.replace(/&(?![a-zA-Z0-9#]{2,6};)/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}const wme=/^\s*javascript\s*(?::|�*58;?|�*3a;?|:?)/i,xme=/^(?:href|src|action|formaction)$/i;function EM(e){return wme.test(e)}function Tme(e){const t=/url\s*\(/gi;let n="",r=0,i;for(;(i=t.exec(e))!==null;){const o=i.index,a=t.lastIndex-1;let s=a+1,l=1,u=null;for(;s`${r}="${NV(r,i)}"`),e=e.replace(/([\w:-]+)\s*=\s*'([^']*)'/g,(n,r,i)=>`${r}='${NV(r,i)}'`),/\s*on\w+\s*=\s*["']?[^"'>]+["']?/gi.test(e)&&(e=e.replace(/(\s+)(on)(\w+\s*=)/gi,"$1on$3")),e=e.replace(/(\s+(?:href|src|action|formaction)\s*=\s*)([^\s"'=<>`]+)/gi,(n,r,i)=>EM(i)?`${r}about:blank`:n),e}const Cme=Object.prototype.hasOwnProperty;function Ps(e,t){return Cme.call(e,t)}const jr=Array.isArray,Ar=e=>typeof e=="function",_t=e=>typeof e=="string",Bn=e=>typeof e=="boolean",Un=e=>e!==null&&typeof e=="object",Ime=e=>Un(e)&&Ar(e.then)&&Ar(e.catch),RX=Object.prototype.toString,CM=e=>RX.call(e),Dn=e=>CM(e)==="[object Object]",Ame=e=>e==null?"":jr(e)||Dn(e)&&e.toString===RX?JSON.stringify(e,null,2):String(e);function IM(e,t=""){return e.reduce((n,r,i)=>i===0?n+r:n+t+r,"")}const Aw=e=>!Un(e)||jr(e);function yT(e,t){if(Aw(e)||Aw(t))throw new Error("Invalid value");const n=[{src:e,des:t}];for(;n.length;){const{src:r,des:i}=n.pop();Object.keys(r).forEach(o=>{o!=="__proto__"&&(Un(r[o])&&!Un(i[o])&&(i[o]=Array.isArray(r[o])?[]:cr()),Aw(i[o])||Aw(r[o])?i[o]=r[o]:n.push({src:r[o],des:i[o]}))})}}function Rme(e,t,n){return{line:e,column:t,offset:n}}function QD(e,t,n){return{start:e,end:t}}const Zn={EXPECTED_TOKEN:1,INVALID_TOKEN_IN_PLACEHOLDER:2,UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER:3,UNKNOWN_ESCAPE_SEQUENCE:4,INVALID_UNICODE_ESCAPE_SEQUENCE:5,UNBALANCED_CLOSING_BRACE:6,UNTERMINATED_CLOSING_BRACE:7,EMPTY_PLACEHOLDER:8,NOT_ALLOW_NEST_PLACEHOLDER:9,INVALID_LINKED_FORMAT:10,MUST_HAVE_MESSAGES_IN_PLURAL:11,UNEXPECTED_EMPTY_LINKED_MODIFIER:12,UNEXPECTED_EMPTY_LINKED_KEY:13,UNEXPECTED_LEXICAL_ANALYSIS:14},kme=17;function kI(e,t,n={}){const{domain:r,messages:i,args:o}=n,a=e,s=new SyntaxError(String(a));return s.code=e,t&&(s.location=t),s.domain=r,s}function Pme(e){throw e}const Ll=" ",Dme="\r",vo=` +`,Ome="\u2028",Lme="\u2029";function Nme(e){const t=e;let n=0,r=1,i=1,o=0;const a=C=>t[C]===Dme&&t[C+1]===vo,s=C=>t[C]===vo,l=C=>t[C]===Lme,u=C=>t[C]===Ome,c=C=>a(C)||s(C)||l(C)||u(C),f=()=>n,h=()=>r,d=()=>i,p=()=>o,v=C=>a(C)||l(C)||u(C)?vo:t[C],y=()=>v(n),m=()=>v(n+o);function b(){return o=0,c(n)&&(r++,i=0),a(n)&&n++,n++,i++,t[n]}function S(){return a(n+o)&&o++,o++,t[n+o]}function w(){n=0,r=1,i=1,o=0}function x(C=0){o=C}function T(){const C=n+o;for(;C!==n;)b();o=0}return{index:f,line:h,column:d,peekOffset:p,charAt:v,currentChar:y,currentPeek:m,next:b,peek:S,reset:w,resetPeek:x,skipToPeek:T}}const Hu=void 0,Mme=".",MV="'",Fme="tokenizer";function $me(e,t={}){const n=t.location!==!1,r=Nme(e),i=()=>r.index(),o=()=>Rme(r.line(),r.column(),r.index()),a=o(),s=i(),l={currentType:13,offset:s,startLoc:a,endLoc:a,lastType:13,lastOffset:s,lastStartLoc:a,lastEndLoc:a,braceNest:0,inLinked:!1,text:""},u=()=>l,{onError:c}=t;function f(Z,oe,ve,...xe){const Pe=u();if(oe.column+=ve,oe.offset+=ve,c){const ze=n?QD(Pe.startLoc,oe):null,de=kI(Z,ze,{domain:Fme,args:xe});c(de)}}function h(Z,oe,ve){Z.endLoc=o(),Z.currentType=oe;const xe={type:oe};return n&&(xe.loc=QD(Z.startLoc,Z.endLoc)),ve!=null&&(xe.value=ve),xe}const d=Z=>h(Z,13);function p(Z,oe){return Z.currentChar()===oe?(Z.next(),oe):(f(Zn.EXPECTED_TOKEN,o(),0,oe),"")}function v(Z){let oe="";for(;Z.currentPeek()===Ll||Z.currentPeek()===vo;)oe+=Z.currentPeek(),Z.peek();return oe}function y(Z){const oe=v(Z);return Z.skipToPeek(),oe}function m(Z){if(Z===Hu)return!1;const oe=Z.charCodeAt(0);return oe>=97&&oe<=122||oe>=65&&oe<=90||oe===95}function b(Z){if(Z===Hu)return!1;const oe=Z.charCodeAt(0);return oe>=48&&oe<=57}function S(Z,oe){const{currentType:ve}=oe;if(ve!==2)return!1;v(Z);const xe=m(Z.currentPeek());return Z.resetPeek(),xe}function w(Z,oe){const{currentType:ve}=oe;if(ve!==2)return!1;v(Z);const xe=Z.currentPeek()==="-"?Z.peek():Z.currentPeek(),Pe=b(xe);return Z.resetPeek(),Pe}function x(Z,oe){const{currentType:ve}=oe;if(ve!==2)return!1;v(Z);const xe=Z.currentPeek()===MV;return Z.resetPeek(),xe}function T(Z,oe){const{currentType:ve}=oe;if(ve!==7)return!1;v(Z);const xe=Z.currentPeek()===".";return Z.resetPeek(),xe}function C(Z,oe){const{currentType:ve}=oe;if(ve!==8)return!1;v(Z);const xe=m(Z.currentPeek());return Z.resetPeek(),xe}function P(Z,oe){const{currentType:ve}=oe;if(!(ve===7||ve===11))return!1;v(Z);const xe=Z.currentPeek()===":";return Z.resetPeek(),xe}function k(Z,oe){const{currentType:ve}=oe;if(ve!==9)return!1;const xe=()=>{const ze=Z.currentPeek();return ze==="{"?m(Z.peek()):ze==="@"||ze==="|"||ze===":"||ze==="."||ze===Ll||!ze?!1:ze===vo?(Z.peek(),xe()):O(Z,!1)},Pe=xe();return Z.resetPeek(),Pe}function L(Z){v(Z);const oe=Z.currentPeek()==="|";return Z.resetPeek(),oe}function O(Z,oe=!0){const ve=(Pe=!1,ze="")=>{const de=Z.currentPeek();return de==="{"||de==="@"||!de?Pe:de==="|"?!(ze===Ll||ze===vo):de===Ll?(Z.peek(),ve(!0,Ll)):de===vo?(Z.peek(),ve(!0,vo)):!0},xe=ve();return oe&&Z.resetPeek(),xe}function M(Z,oe){const ve=Z.currentChar();return ve===Hu?Hu:oe(ve)?(Z.next(),ve):null}function F(Z){const oe=Z.charCodeAt(0);return oe>=97&&oe<=122||oe>=65&&oe<=90||oe>=48&&oe<=57||oe===95||oe===36}function U(Z){return M(Z,F)}function X(Z){const oe=Z.charCodeAt(0);return oe>=97&&oe<=122||oe>=65&&oe<=90||oe>=48&&oe<=57||oe===95||oe===36||oe===45}function $(Z){return M(Z,X)}function W(Z){const oe=Z.charCodeAt(0);return oe>=48&&oe<=57}function G(Z){return M(Z,W)}function Q(Z){const oe=Z.charCodeAt(0);return oe>=48&&oe<=57||oe>=65&&oe<=70||oe>=97&&oe<=102}function ne(Z){return M(Z,Q)}function re(Z){let oe="",ve="";for(;oe=G(Z);)ve+=oe;return ve}function pe(Z){let oe="";for(;;){const ve=Z.currentChar();if(ve==="\\"){const xe=Z.peek();xe==="{"||xe==="}"||xe==="@"||xe==="|"||xe==="\\"?(oe+=ve+xe,Z.next(),Z.next()):(Z.resetPeek(),oe+=ve,Z.next())}else{if(ve==="{"||ve==="}"||ve==="@"||ve==="|"||!ve)break;if(ve===Ll||ve===vo)if(O(Z))oe+=ve,Z.next();else{if(L(Z))break;oe+=ve,Z.next()}else oe+=ve,Z.next()}}return oe}function ke(Z){y(Z);let oe="",ve="";for(;oe=$(Z);)ve+=oe;const xe=Z.currentChar();if(xe&&xe!=="}"&&xe!==Hu&&xe!==Ll&&xe!==vo&&xe!==" "){const Pe=Ue(Z);return f(Zn.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,ve+Pe),ve+Pe}return Z.currentChar()===Hu&&f(Zn.UNTERMINATED_CLOSING_BRACE,o(),0),ve}function Re(Z){y(Z);let oe="";return Z.currentChar()==="-"?(Z.next(),oe+=`-${re(Z)}`):oe+=re(Z),Z.currentChar()===Hu&&f(Zn.UNTERMINATED_CLOSING_BRACE,o(),0),oe}function Me(Z){return Z!==MV&&Z!==vo}function be(Z){y(Z),p(Z,"'");let oe="",ve="";for(;oe=M(Z,Me);)oe==="\\"?ve+=fe(Z):ve+=oe;const xe=Z.currentChar();return xe===vo||xe===Hu?(f(Zn.UNTERMINATED_SINGLE_QUOTE_IN_PLACEHOLDER,o(),0),xe===vo&&(Z.next(),p(Z,"'")),ve):(p(Z,"'"),ve)}function fe(Z){const oe=Z.currentChar();switch(oe){case"\\":case"'":return Z.next(),`\\${oe}`;case"u":return Le(Z,oe,4);case"U":return Le(Z,oe,6);default:return f(Zn.UNKNOWN_ESCAPE_SEQUENCE,o(),0,oe),""}}function Le(Z,oe,ve){p(Z,oe);let xe="";for(let Pe=0;Pe{const xe=Z.currentChar();return xe==="{"||xe==="@"||xe==="|"||xe==="("||xe===")"||!xe||xe===Ll?ve:(ve+=xe,Z.next(),oe(ve))};return oe("")}function J(Z){y(Z);const oe=p(Z,"|");return y(Z),oe}function ie(Z,oe){let ve=null;switch(Z.currentChar()){case"{":return oe.braceNest>=1&&f(Zn.NOT_ALLOW_NEST_PLACEHOLDER,o(),0),Z.next(),ve=h(oe,2,"{"),y(Z),oe.braceNest++,ve;case"}":return oe.braceNest>0&&oe.currentType===2&&f(Zn.EMPTY_PLACEHOLDER,o(),0),Z.next(),ve=h(oe,3,"}"),oe.braceNest--,oe.braceNest>0&&y(Z),oe.inLinked&&oe.braceNest===0&&(oe.inLinked=!1),ve;case"@":return oe.braceNest>0&&f(Zn.UNTERMINATED_CLOSING_BRACE,o(),0),ve=ge(Z,oe)||d(oe),oe.braceNest=0,ve;default:{let Pe=!0,ze=!0,de=!0;if(L(Z))return oe.braceNest>0&&f(Zn.UNTERMINATED_CLOSING_BRACE,o(),0),ve=h(oe,1,J(Z)),oe.braceNest=0,oe.inLinked=!1,ve;if(oe.braceNest>0&&(oe.currentType===4||oe.currentType===5||oe.currentType===6))return f(Zn.UNTERMINATED_CLOSING_BRACE,o(),0),oe.braceNest=0,Te(Z,oe);if(Pe=S(Z,oe))return ve=h(oe,4,ke(Z)),y(Z),ve;if(ze=w(Z,oe))return ve=h(oe,5,Re(Z)),y(Z),ve;if(de=x(Z,oe))return ve=h(oe,6,be(Z)),y(Z),ve;if(!Pe&&!ze&&!de)return ve=h(oe,12,Ue(Z)),f(Zn.INVALID_TOKEN_IN_PLACEHOLDER,o(),0,ve.value),y(Z),ve;break}}return ve}function ge(Z,oe){const{currentType:ve}=oe;let xe=null;const Pe=Z.currentChar();switch((ve===7||ve===8||ve===11||ve===9)&&(Pe===vo||Pe===Ll)&&f(Zn.INVALID_LINKED_FORMAT,o(),0),Pe){case"@":return Z.next(),xe=h(oe,7,"@"),oe.inLinked=!0,xe;case".":return y(Z),Z.next(),h(oe,8,".");case":":return y(Z),Z.next(),h(oe,9,":");default:return L(Z)?(xe=h(oe,1,J(Z)),oe.braceNest=0,oe.inLinked=!1,xe):T(Z,oe)||P(Z,oe)?(y(Z),ge(Z,oe)):C(Z,oe)?(y(Z),h(oe,11,Be(Z))):k(Z,oe)?(y(Z),Pe==="{"?ie(Z,oe)||xe:h(oe,10,Xe(Z))):(ve===7&&f(Zn.INVALID_LINKED_FORMAT,o(),0),oe.braceNest=0,oe.inLinked=!1,Te(Z,oe))}}function Te(Z,oe){let ve={type:13};if(oe.braceNest>0)return ie(Z,oe)||d(oe);if(oe.inLinked)return ge(Z,oe)||d(oe);switch(Z.currentChar()){case"{":return ie(Z,oe)||d(oe);case"}":return f(Zn.UNBALANCED_CLOSING_BRACE,o(),0),Z.next(),h(oe,3,"}");case"@":return ge(Z,oe)||d(oe);default:{if(L(Z))return ve=h(oe,1,J(Z)),oe.braceNest=0,oe.inLinked=!1,ve;if(O(Z))return h(oe,0,pe(Z));break}}return ve}function Oe(){const{currentType:Z,offset:oe,startLoc:ve,endLoc:xe}=l;return l.lastType=Z,l.lastOffset=oe,l.lastStartLoc=ve,l.lastEndLoc=xe,l.offset=i(),l.startLoc=o(),r.currentChar()===Hu?h(l,13):Te(r,l)}return{nextToken:Oe,currentOffset:i,currentPosition:o,context:u}}const Bme="parser",Vme=/(?:\\\\|\\'|\\u([0-9a-fA-F]{4})|\\U([0-9a-fA-F]{6}))/g,Ume=/\\([\\@{}|])/g;function Gme(e,t){return t}function Hme(e,t,n){switch(e){case"\\\\":return"\\";case"\\'":return"'";default:{const r=parseInt(t||n,16);return r<=55295||r>=57344?String.fromCodePoint(r):"�"}}}function Wme(e={}){const t=e.location!==!1,{onError:n}=e;function r(m,b,S,w,...x){const T=m.currentPosition();if(T.offset+=w,T.column+=w,n){const C=t?QD(S,T):null,P=kI(b,C,{domain:Bme,args:x});n(P)}}function i(m,b,S){const w={type:m};return t&&(w.start=b,w.end=b,w.loc={start:S,end:S}),w}function o(m,b,S,w){t&&(m.end=b,m.loc&&(m.loc.end=S))}function a(m,b){const S=m.context(),w=i(3,S.offset,S.startLoc);return w.value=b.replace(Ume,Gme),o(w,m.currentOffset(),m.currentPosition()),w}function s(m,b){const S=m.context(),{lastOffset:w,lastStartLoc:x}=S,T=i(5,w,x);return T.index=parseInt(b,10),m.nextToken(),o(T,m.currentOffset(),m.currentPosition()),T}function l(m,b){const S=m.context(),{lastOffset:w,lastStartLoc:x}=S,T=i(4,w,x);return T.key=b,m.nextToken(),o(T,m.currentOffset(),m.currentPosition()),T}function u(m,b){const S=m.context(),{lastOffset:w,lastStartLoc:x}=S,T=i(9,w,x);return T.value=b.replace(Vme,Hme),m.nextToken(),o(T,m.currentOffset(),m.currentPosition()),T}function c(m){const b=m.nextToken(),S=m.context(),{lastOffset:w,lastStartLoc:x}=S,T=i(8,w,x);return b.type!==11?(r(m,Zn.UNEXPECTED_EMPTY_LINKED_MODIFIER,S.lastStartLoc,0),T.value="",o(T,w,x),{nextConsumeToken:b,node:T}):(b.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,Nl(b)),T.value=b.value||"",o(T,m.currentOffset(),m.currentPosition()),{node:T})}function f(m,b){const S=m.context(),w=i(7,S.offset,S.startLoc);return w.value=b,o(w,m.currentOffset(),m.currentPosition()),w}function h(m){const b=m.context(),S=i(6,b.offset,b.startLoc);let w=m.nextToken();if(w.type===8){const x=c(m);S.modifier=x.node,w=x.nextConsumeToken||m.nextToken()}switch(w.type!==9&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(w)),w=m.nextToken(),w.type===2&&(w=m.nextToken()),w.type){case 10:w.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(w)),S.key=f(m,w.value||"");break;case 4:w.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(w)),S.key=l(m,w.value||"");break;case 5:w.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(w)),S.key=s(m,w.value||"");break;case 6:w.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(w)),S.key=u(m,w.value||"");break;default:{r(m,Zn.UNEXPECTED_EMPTY_LINKED_KEY,b.lastStartLoc,0);const x=m.context(),T=i(7,x.offset,x.startLoc);return T.value="",o(T,x.offset,x.startLoc),S.key=T,o(S,x.offset,x.startLoc),{nextConsumeToken:w,node:S}}}return o(S,m.currentOffset(),m.currentPosition()),{node:S}}function d(m){const b=m.context(),S=b.currentType===1?m.currentOffset():b.offset,w=b.currentType===1?b.endLoc:b.startLoc,x=i(2,S,w);x.items=[];let T=null;do{const k=T||m.nextToken();switch(T=null,k.type){case 0:k.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(k)),x.items.push(a(m,k.value||""));break;case 5:k.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(k)),x.items.push(s(m,k.value||""));break;case 4:k.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(k)),x.items.push(l(m,k.value||""));break;case 6:k.value==null&&r(m,Zn.UNEXPECTED_LEXICAL_ANALYSIS,b.lastStartLoc,0,Nl(k)),x.items.push(u(m,k.value||""));break;case 7:{const L=h(m);x.items.push(L.node),T=L.nextConsumeToken||null;break}}}while(b.currentType!==13&&b.currentType!==1);const C=b.currentType===1?b.lastOffset:m.currentOffset(),P=b.currentType===1?b.lastEndLoc:m.currentPosition();return o(x,C,P),x}function p(m,b,S,w){const x=m.context();let T=w.items.length===0;const C=i(1,b,S);C.cases=[],C.cases.push(w);do{const P=d(m);T||(T=P.items.length===0),C.cases.push(P)}while(x.currentType!==13);return T&&r(m,Zn.MUST_HAVE_MESSAGES_IN_PLURAL,S,0),o(C,m.currentOffset(),m.currentPosition()),C}function v(m){const b=m.context(),{offset:S,startLoc:w}=b,x=d(m);return b.currentType===13?x:p(m,S,w,x)}function y(m){const b=$me(m,pi({},e)),S=b.context(),w=i(0,S.offset,S.startLoc);return t&&w.loc&&(w.loc.source=m),w.body=v(b),e.onCacheKey&&(w.cacheKey=e.onCacheKey(m)),S.currentType!==13&&r(b,Zn.UNEXPECTED_LEXICAL_ANALYSIS,S.lastStartLoc,0,m[S.offset]||""),o(w,b.currentOffset(),b.currentPosition()),w}return{parse:y}}function Nl(e){if(e.type===13)return"EOF";const t=(e.value||"").replace(/\r?\n/gu,"\\n");return t.length>10?t.slice(0,9)+"…":t}function zme(e,t={}){const n={ast:e,helpers:new Set};return{context:()=>n,helper:o=>(n.helpers.add(o),o)}}function FV(e,t){for(let n=0;n$V(n)),e}function $V(e){if(e.items.length===1){const t=e.items[0];(t.type===3||t.type===9)&&(e.static=t.value,delete t.value)}else{const t=[];for(let n=0;na;function l(v,y){a.code+=v}function u(v,y=!0){const m=y?r:"";l(i?m+" ".repeat(v):m)}function c(v=!0){const y=++a.indentLevel;v&&u(y)}function f(v=!0){const y=--a.indentLevel;v&&u(y)}function h(){u(a.indentLevel)}return{context:s,push:l,indent:c,deindent:f,newline:h,helper:v=>`_${v}`,needIndent:()=>a.needIndent}}function Kme(e,t){const{helper:n}=e;e.push(`${n("linked")}(`),fm(e,t.key),t.modifier?(e.push(", "),fm(e,t.modifier),e.push(", _type")):e.push(", undefined, _type"),e.push(")")}function Zme(e,t){const{helper:n,needIndent:r}=e;e.push(`${n("normalize")}([`),e.indent(r());const i=t.items.length;for(let o=0;o1){e.push(`${n("plural")}([`),e.indent(r());const i=t.cases.length;for(let o=0;o{const n=_t(t.mode)?t.mode:"normal",r=_t(t.filename)?t.filename:"message.intl";t.sourceMap;const i=t.breakLineCode!=null?t.breakLineCode:n==="arrow"?";":` +`,o=t.needIndent?t.needIndent:n!=="arrow",a=e.helpers||[],s=Xme(e,{filename:r,breakLineCode:i,needIndent:o});s.push(n==="normal"?"function __msg__ (ctx) {":"(ctx) => {"),s.indent(o),a.length>0&&(s.push(`const { ${IM(a.map(c=>`${c}: _${c}`),", ")} } = ctx`),s.newline()),s.push("return "),fm(s,e),s.deindent(o),s.push("}"),delete e.helpers;const{code:l,map:u}=s.context();return{ast:e,code:l,map:u?u.toJSON():void 0}};function eye(e,t={}){const n=pi({},t),r=!!n.jit,i=!!n.minify,o=n.optimize==null?!0:n.optimize,s=Wme(n).parse(e);return r?(o&&jme(s),i&&rg(s),{ast:s,code:""}):(Yme(s,n),qme(s,n))}function tye(){typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Gh().__INTLIFY_PROD_DEVTOOLS__=!1),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Gh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1)}function fu(e){return Un(e)&&RM(e)===0&&(Ps(e,"b")||Ps(e,"body"))}const kX=["b","body"];function nye(e){return Td(e,kX)}const PX=["c","cases"];function rye(e){return Td(e,PX,[])}const DX=["s","static"];function iye(e){return Td(e,DX)}const OX=["i","items"];function oye(e){return Td(e,OX,[])}const LX=["t","type"];function RM(e){return Td(e,LX)}const NX=["v","value"];function Rw(e,t){const n=Td(e,NX);if(n!=null)return n;throw T1(t)}const MX=["m","modifier"];function aye(e){return Td(e,MX)}const FX=["k","key"];function sye(e){const t=Td(e,FX);if(t)return t;throw T1(6)}function Td(e,t,n){for(let r=0;rlye(n,e)}function lye(e,t){const n=nye(t);if(n==null)throw T1(0);if(RM(n)===1){const o=rye(n);return e.plural(o.reduce((a,s)=>[...a,BV(e,s)],[]))}else return BV(e,n)}function BV(e,t){const n=iye(t);if(n!=null)return e.type==="text"?n:e.normalize([n]);{const r=oye(t).reduce((i,o)=>[...i,qD(e,o)],[]);return e.normalize(r)}}function qD(e,t){const n=RM(t);switch(n){case 3:return Rw(t,n);case 9:return Rw(t,n);case 4:{const r=t;if(Ps(r,"k")&&r.k)return e.interpolate(e.named(r.k));if(Ps(r,"key")&&r.key)return e.interpolate(e.named(r.key));throw T1(n)}case 5:{const r=t;if(Ps(r,"i")&&hi(r.i))return e.interpolate(e.list(r.i));if(Ps(r,"index")&&hi(r.index))return e.interpolate(e.list(r.index));throw T1(n)}case 6:{const r=t,i=aye(r),o=sye(r);return e.linked(qD(e,o),i?qD(e,i):void 0,e.type)}case 7:return Rw(t,n);case 8:return Rw(t,n);default:throw new Error(`unhandled node on format message part: ${n}`)}}const uye=e=>e;let kw=cr();function cye(e,t={}){let n=!1;const r=t.onError||Pme;return t.onError=i=>{n=!0,r(i)},{...eye(e,t),detectError:n}}function fye(e,t){if(!__INTLIFY_DROP_MESSAGE_COMPILER__&&_t(e)){Bn(t.warnHtmlMessage)&&t.warnHtmlMessage;const r=(t.onCacheKey||uye)(e),i=kw[r];if(i)return i;const{ast:o,detectError:a}=cye(e,{...t,location:!1,jit:!0}),s=OR(o);return a?s:kw[r]=s}else{const n=e.cacheKey;if(n){const r=kw[n];return r||(kw[n]=OR(e))}else return OR(e)}}let E1=null;function dye(e){E1=e}function hye(e,t,n){E1&&E1.emit("i18n:init",{timestamp:Date.now(),i18n:e,version:t,meta:n})}const pye=vye("function:translate");function vye(e){return t=>E1&&E1.emit(e,t)}const fc={INVALID_ARGUMENT:kme,INVALID_DATE_ARGUMENT:18,INVALID_ISO_DATE_ARGUMENT:19,NOT_SUPPORT_LOCALE_PROMISE_VALUE:21,NOT_SUPPORT_LOCALE_ASYNC_FUNCTION:22,NOT_SUPPORT_LOCALE_TYPE:23},gye=24;function dc(e){return kI(e,null,void 0)}function kM(e,t){return t.locale!=null?VV(t.locale):VV(e.locale)}let LR;function VV(e){if(_t(e))return e;if(Ar(e)){if(e.resolvedOnce&&LR!=null)return LR;if(e.constructor.name==="Function"){const t=e();if(Ime(t))throw dc(fc.NOT_SUPPORT_LOCALE_PROMISE_VALUE);return LR=t}else throw dc(fc.NOT_SUPPORT_LOCALE_ASYNC_FUNCTION)}else throw dc(fc.NOT_SUPPORT_LOCALE_TYPE)}function mye(e,t,n){return[...new Set([n,...jr(t)?t:Un(t)?Object.keys(t):_t(t)?[t]:[n]])]}function eO(e,t,n){const r=_t(n)?n:C1,i=e;i.__localeChainCache||(i.__localeChainCache=new Map);let o=i.__localeChainCache.get(r);if(!o){o=[];let a=[n];for(;jr(a);)a=UV(o,a,t);const s=jr(t)||!Dn(t)?t:t.default?t.default:null;a=_t(s)?[s]:s,jr(a)&&UV(o,a,!1),i.__localeChainCache.set(r,o)}return o}function UV(e,t,n){let r=!0;for(let i=0;i{a===void 0?a=s:a+=s},h[1]=()=>{a!==void 0&&(t.push(a),a=void 0)},h[2]=()=>{h[0](),i++},h[3]=()=>{if(i>0)i--,r=4,h[0]();else{if(i=0,a===void 0||(a=Tye(a),a===!1))return!1;h[1]()}};function d(){const p=e[n+1];if(r===5&&p==="'"||r===6&&p==='"')return n++,s="\\"+p,h[0](),!0}for(;r!==null;)if(n++,o=e[n],!(o==="\\"&&d())){if(l=xye(o),f=Ed[r],u=f[l]||f.l||8,u===8||(r=u[0],u[1]!==void 0&&(c=h[u[1]],c&&(s=o,c()===!1))))return;if(r===7)return t}}const GV=new Map;function Cye(e,t){return Un(e)?e[t]:null}function Iye(e,t){if(!Un(e))return null;let n=GV.get(t);if(n||(n=Eye(t),n&&GV.set(t,n)),!n)return null;const r=n.length;let i=e,o=0;for(;o`${e.charAt(0).toLocaleUpperCase()}${e.substr(1)}`;function Rye(){return{upper:(e,t)=>t==="text"&&_t(e)?e.toUpperCase():t==="vnode"&&Un(e)&&"__v_isVNode"in e?e.children.toUpperCase():e,lower:(e,t)=>t==="text"&&_t(e)?e.toLowerCase():t==="vnode"&&Un(e)&&"__v_isVNode"in e?e.children.toLowerCase():e,capitalize:(e,t)=>t==="text"&&_t(e)?HV(e):t==="vnode"&&Un(e)&&"__v_isVNode"in e?HV(e.children):e}}let BX;function kye(e){BX=e}let VX;function Pye(e){VX=e}let UX;function Dye(e){UX=e}let GX=null;const Oye=e=>{GX=e},Lye=()=>GX;let HX=null;const WV=e=>{HX=e},Nye=()=>HX;let zV=0;function Mye(e={}){const t=Ar(e.onWarn)?e.onWarn:mme,n=_t(e.version)?e.version:Aye,r=_t(e.locale)||Ar(e.locale)?e.locale:C1,i=Ar(r)?C1:r,o=jr(e.fallbackLocale)||Dn(e.fallbackLocale)||_t(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:i,a=Dn(e.messages)?e.messages:NR(i),s=Dn(e.datetimeFormats)?e.datetimeFormats:NR(i),l=Dn(e.numberFormats)?e.numberFormats:NR(i),u=pi(cr(),e.modifiers,Rye()),c=e.pluralRules||cr(),f=Ar(e.missing)?e.missing:null,h=Bn(e.missingWarn)||cm(e.missingWarn)?e.missingWarn:!0,d=Bn(e.fallbackWarn)||cm(e.fallbackWarn)?e.fallbackWarn:!0,p=!!e.fallbackFormat,v=!!e.unresolving,y=Ar(e.postTranslation)?e.postTranslation:null,m=Dn(e.processor)?e.processor:null,b=Bn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,S=!!e.escapeParameter,w=Ar(e.messageCompiler)?e.messageCompiler:BX,x=Ar(e.messageResolver)?e.messageResolver:VX||Cye,T=Ar(e.localeFallbacker)?e.localeFallbacker:UX||mye,C=Un(e.fallbackContext)?e.fallbackContext:void 0,P=e,k=Un(P.__datetimeFormatters)?P.__datetimeFormatters:new Map,L=Un(P.__numberFormatters)?P.__numberFormatters:new Map,O=Un(P.__meta)?P.__meta:{};zV++;const M={version:n,cid:zV,locale:r,fallbackLocale:o,messages:a,modifiers:u,pluralRules:c,missing:f,missingWarn:h,fallbackWarn:d,fallbackFormat:p,unresolving:v,postTranslation:y,processor:m,warnHtmlMessage:b,escapeParameter:S,messageCompiler:w,messageResolver:x,localeFallbacker:T,fallbackContext:C,onWarn:t,__meta:O};return M.datetimeFormats=s,M.numberFormats=l,M.__datetimeFormatters=k,M.__numberFormatters=L,__INTLIFY_PROD_DEVTOOLS__&&hye(M,n,O),M}const NR=e=>({[e]:cr()});function PM(e,t,n,r,i){const{missing:o,onWarn:a}=e;if(o!==null){const s=o(e,n,t,i);return _t(s)?s:t}else return t}function i0(e,t,n){const r=e;r.__localeChainCache=new Map,e.localeFallbacker(e,n,t)}function Fye(e,t){return e===t?!1:e.split("-")[0]===t.split("-")[0]}function $ye(e,t){const n=t.indexOf(e);if(n===-1)return!1;for(let r=n+1;r{WX.includes(l)?a[l]=n[l]:o[l]=n[l]}),_t(r)?o.locale=r:Dn(r)&&(a=r),Dn(i)&&(a=i),[o.key||"",s,o,a]}function jV(e,t,n){const r=e;for(const i in n){const o=`${t}__${i}`;r.__datetimeFormatters.has(o)&&r.__datetimeFormatters.delete(o)}}function XV(e,...t){const{numberFormats:n,unresolving:r,fallbackLocale:i,onWarn:o,localeFallbacker:a}=e,{__numberFormatters:s}=e;if(!hi(t[0]))return BE;const[l,u,c,f]=nO(...t),h=Bn(c.missingWarn)?c.missingWarn:e.missingWarn;Bn(c.fallbackWarn)?c.fallbackWarn:e.fallbackWarn;const d=!!c.part,p=kM(e,c),v=a(e,i,p);if(!_t(l)||l===""){const T=new Intl.NumberFormat(p.replace(/!/g,""),f);return d?T.formatToParts(u):T.format(u)}let y={},m,b=null;const S="number format";for(let T=0;T{zX.includes(l)?a[l]=n[l]:o[l]=n[l]}),_t(r)?o.locale=r:Dn(r)&&(a=r),Dn(i)&&(a=i),[o.key||"",s,o,a]}function KV(e,t,n){const r=e;for(const i in n){const o=`${t}__${i}`;r.__numberFormatters.has(o)&&r.__numberFormatters.delete(o)}}const Bye=e=>e,Vye=e=>"",Uye="text",Gye=e=>e.length===0?"":IM(e),Hye=Ame;function MR(e,t){return e=Math.abs(e),t===2?e===1?0:1:Math.min(e,2)}function Wye(e){const t=hi(e.pluralIndex)?e.pluralIndex:-1;return hi(e.named?.count)?e.named.count:hi(e.named?.n)?e.named.n:t}function zye(e={}){const t=e.locale,n=Wye(e),r=_t(t)&&Ar(e.pluralRules?.[t])?e.pluralRules[t]:MR,i=r===MR?void 0:MR,o=m=>m[r(n,m.length,i)],a=e.list||[],s=m=>a[m],l=e.named||cr();hi(e.pluralIndex)&&(l.count||=e.pluralIndex,l.n||=e.pluralIndex);const u=m=>l[m];function c(m,b){const S=Ar(e.messages)?e.messages(m,!!b):Un(e.messages)?e.messages[m]:!1;return S||(e.parent?e.parent.message(m):Vye)}const f=m=>e.modifiers?e.modifiers[m]:Bye,h=Ar(e.processor?.normalize)?e.processor.normalize:Gye,d=Ar(e.processor?.interpolate)?e.processor.interpolate:Hye,p=_t(e.processor?.type)?e.processor.type:Uye,y={list:s,named:u,plural:o,linked:(m,...b)=>{const[S,w]=b;let x="text",T="";b.length===1?Un(S)?(T=S.modifier||T,x=S.type||x):_t(S)&&(T=S||T):b.length===2&&(_t(S)&&(T=S||T),_t(w)&&(x=w||x));const C=c(m,!0)(y),P=C===""||C===void 0?m:C,k=x==="vnode"&&jr(P)&&T?P[0]:P;return T?f(T)(k,x):k},message:c,type:p,interpolate:d,normalize:h,values:pi(cr(),a,l)};return y}const ZV=()=>"",ws=e=>Ar(e);function JV(e,...t){const{fallbackFormat:n,postTranslation:r,unresolving:i,messageCompiler:o,fallbackLocale:a,messages:s}=e,[l,u]=rO(...t),c=Bn(u.missingWarn)?u.missingWarn:e.missingWarn,f=Bn(u.fallbackWarn)?u.fallbackWarn:e.fallbackWarn,h=Bn(u.escapeParameter)?u.escapeParameter:e.escapeParameter,d=!!u.resolvedMessage,p=_t(u.default)||Bn(u.default)?Bn(u.default)?o?l:()=>l:u.default:n?o?l:()=>l:null,v=n||p!=null&&(_t(p)||Ar(p)),y=kM(e,u);h&&Yye(u);let[m,b,S]=d?[l,y,s[y]||cr()]:YX(e,l,y,a,f,c),w=m,x=l;if(!d&&!(_t(w)||fu(w)||ws(w))&&v&&(w=p,x=w),!d&&(!(_t(w)||fu(w)||ws(w))||!_t(b)))return i?PI:l;let T=!1;const C=()=>{T=!0},P=ws(w)?w:jX(e,l,b,w,x,C);if(T)return w;const k=Kye(e,b,S,u),L=zye(k),O=jye(e,P,L);let M=r?r(O,l):O;if(h&&_t(M)&&(M=Eme(M)),__INTLIFY_PROD_DEVTOOLS__){const F={timestamp:Date.now(),key:_t(l)?l:ws(w)?w.key:"",locale:b||(ws(w)?w.locale:""),format:_t(w)?w:ws(w)?w.source:"",message:M};F.meta=pi({},e.__meta,Lye()||{}),pye(F)}return M}function Yye(e){jr(e.list)?e.list=e.list.map(t=>_t(t)?LV(t):t):Un(e.named)&&Object.keys(e.named).forEach(t=>{_t(e.named[t])&&(e.named[t]=LV(e.named[t]))})}function YX(e,t,n,r,i,o){const{messages:a,onWarn:s,messageResolver:l,localeFallbacker:u}=e,c=u(e,r,n);let f=cr(),h,d=null;const p="translate";for(let v=0;vr);return u.locale=n,u.key=t,u}const l=a(r,Xye(e,n,i,r,s,o));return l.locale=n,l.key=t,l.source=r,l}function jye(e,t,n){return t(n)}function rO(...e){const[t,n,r]=e,i=cr();if(!_t(t)&&!hi(t)&&!ws(t)&&!fu(t))throw dc(fc.INVALID_ARGUMENT);const o=hi(t)?String(t):(ws(t),t);return hi(n)?i.plural=n:_t(n)?i.default=n:Dn(n)&&!RI(n)?i.named=n:jr(n)&&(i.list=n),hi(r)?i.plural=r:_t(r)?i.default=r:Dn(r)&&pi(i,r),[o,i]}function Xye(e,t,n,r,i,o){return{locale:t,key:n,warnHtmlMessage:i,onError:a=>{throw o&&o(a),a},onCacheKey:a=>yme(t,n,a)}}function Kye(e,t,n,r){const{modifiers:i,pluralRules:o,messageResolver:a,fallbackLocale:s,fallbackWarn:l,missingWarn:u,fallbackContext:c}=e,h={locale:t,modifiers:i,pluralRules:o,messages:(d,p)=>{let v=a(n,d);if(v==null&&(c||p)){const[y,,m]=YX(c||e,d,t,s,l,u);v=y??a(m,d)}if(_t(v)||fu(v)){let y=!1;const b=jX(e,d,t,v,d,()=>{y=!0});return y?ZV:b}else return ws(v)?v:ZV}};return e.processor&&(h.processor=e.processor),r.list&&(h.list=r.list),r.named&&(h.named=r.named),hi(r.plural)&&(h.pluralIndex=r.plural),h}tye();const Zye="11.4.5";function Jye(){typeof __VUE_I18N_FULL_INSTALL__!="boolean"&&(Gh().__VUE_I18N_FULL_INSTALL__=!0),typeof __VUE_I18N_LEGACY_API__!="boolean"&&(Gh().__VUE_I18N_LEGACY_API__=!0),typeof __INTLIFY_DROP_MESSAGE_COMPILER__!="boolean"&&(Gh().__INTLIFY_DROP_MESSAGE_COMPILER__=!1),typeof __INTLIFY_PROD_DEVTOOLS__!="boolean"&&(Gh().__INTLIFY_PROD_DEVTOOLS__=!1)}const Qo={UNEXPECTED_RETURN_TYPE:gye,INVALID_ARGUMENT:25,MUST_BE_CALL_SETUP_TOP:26,NOT_INSTALLED:27,REQUIRED_VALUE:28,INVALID_VALUE:29,NOT_INSTALLED_WITH_PROVIDE:31,UNEXPECTED_ERROR:32,NOT_AVAILABLE_COMPOSITION_IN_LEGACY:34};function Ia(e,...t){return kI(e,null,void 0)}const iO=xd("__translateVNode"),oO=xd("__datetimeParts"),aO=xd("__numberParts"),XX=xd("__setPluralRules"),KX=xd("__injectWithOption"),hg=xd("__dispose");function I1(e){if(!Un(e)||fu(e))return e;for(const t in e)if(Ps(e,t))if(!t.includes("."))Un(e[t])&&I1(e[t]);else{const n=t.split("."),r=n.length-1;let i=e,o=!1;for(let a=0;a{if("locale"in s&&"resource"in s){const{locale:l,resource:u}=s;l?(a[l]=a[l]||cr(),yT(u,a[l])):yT(u,a)}else _t(s)&&yT(JSON.parse(s),a)}),i==null&&o)for(const s in a)Ps(a,s)&&I1(a[s]);return a}function ZX(e){return e.type}function JX(e,t,n){let r=Un(t.messages)?t.messages:cr();"__i18nGlobal"in n&&(r=DM(e.locale.value,{messages:r,__i18n:n.__i18nGlobal}));const i=Object.keys(r);i.length&&i.forEach(o=>{e.mergeLocaleMessage(o,r[o])});{if(Un(t.datetimeFormats)){const o=Object.keys(t.datetimeFormats);o.length&&o.forEach(a=>{e.mergeDateTimeFormat(a,t.datetimeFormats[a])})}if(Un(t.numberFormats)){const o=Object.keys(t.numberFormats);o.length&&o.forEach(a=>{e.mergeNumberFormat(a,t.numberFormats[a])})}}}function QV(e){return B(_c,null,e,0)}function A1(){return vi()}const qV="__INTLIFY_META__",eU=()=>[],Qye=()=>!1;let tU=0;function nU(e){return((t,n,r,i)=>e(n,r,A1()||void 0,i))}const qye=()=>{const e=A1();let t=null;return e&&(t=ZX(e)[qV])?{[qV]:t}:null};function VE(e={}){const{__root:t,__injectWithOption:n}=e,r=t===void 0,i=e.flatJson,o=$E?me:mn;let a=Bn(e.inheritLocale)?e.inheritLocale:!0;const s=o(t&&a?t.locale.value:_t(e.locale)?e.locale:C1),l=o(t&&a?t.fallbackLocale.value:_t(e.fallbackLocale)||jr(e.fallbackLocale)||Dn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:s.value),u=o(DM(s.value,e)),c=o(Dn(e.datetimeFormats)?e.datetimeFormats:{[s.value]:{}}),f=o(Dn(e.numberFormats)?e.numberFormats:{[s.value]:{}});let h=t?t.missingWarn:Bn(e.missingWarn)||cm(e.missingWarn)?e.missingWarn:!0,d=t?t.fallbackWarn:Bn(e.fallbackWarn)||cm(e.fallbackWarn)?e.fallbackWarn:!0,p=t?t.fallbackRoot:Bn(e.fallbackRoot)?e.fallbackRoot:!0,v=!!e.fallbackFormat,y=Ar(e.missing)?e.missing:null,m=Ar(e.missing)?nU(e.missing):null,b=Ar(e.postTranslation)?e.postTranslation:null,S=t?t.warnHtmlMessage:Bn(e.warnHtmlMessage)?e.warnHtmlMessage:!0,w=!!e.escapeParameter;const x=t?t.modifiers:Dn(e.modifiers)?e.modifiers:{};let T=e.pluralRules||t&&t.pluralRules,C;C=(()=>{r&&WV(null);const de={version:Zye,locale:s.value,fallbackLocale:l.value,messages:u.value,modifiers:x,pluralRules:T,missing:m===null?void 0:m,missingWarn:h,fallbackWarn:d,fallbackFormat:v,unresolving:!0,postTranslation:b===null?void 0:b,warnHtmlMessage:S,escapeParameter:w,messageResolver:e.messageResolver,messageCompiler:e.messageCompiler,__meta:{framework:"vue"}};de.datetimeFormats=c.value,de.numberFormats=f.value,de.__datetimeFormatters=Dn(C)?C.__datetimeFormatters:void 0,de.__numberFormatters=Dn(C)?C.__numberFormatters:void 0;const Ie=Mye(de);return r&&WV(Ie),Ie})(),i0(C,s.value,l.value);function k(){return[s.value,l.value,u.value,c.value,f.value]}const L=ae({get:()=>s.value,set:de=>{C.locale=de,s.value=de}}),O=ae({get:()=>l.value,set:de=>{C.fallbackLocale=de,l.value=de,i0(C,s.value,de)}}),M=ae(()=>u.value),F=ae(()=>c.value),U=ae(()=>f.value);function X(){return Ar(b)?b:null}function $(de){b=de,C.postTranslation=de}function W(){return y}function G(de){de!==null&&(m=nU(de)),y=de,C.missing=m}const Q=(de,Ie,it,Y,D,A)=>{k();let H;try{__INTLIFY_PROD_DEVTOOLS__,r||(C.fallbackContext=t?Nye():void 0),H=de(C)}finally{__INTLIFY_PROD_DEVTOOLS__,r||(C.fallbackContext=void 0)}if(it!=="translate exists"&&hi(H)&&H===PI||it==="translate exists"&&!H){const[q,le]=Ie();return t&&p?Y(t):D(q)}else{if(A(H))return H;throw Ia(Qo.UNEXPECTED_RETURN_TYPE)}};function ne(...de){return Q(Ie=>Reflect.apply(JV,null,[Ie,...de]),()=>rO(...de),"translate",Ie=>Reflect.apply(Ie.t,Ie,[...de]),Ie=>Ie,Ie=>_t(Ie))}function re(...de){const[Ie,it,Y]=de;if(Y&&!Un(Y))throw Ia(Qo.INVALID_ARGUMENT);return ne(Ie,it,pi({resolvedMessage:!0},Y||{}))}function pe(...de){return Q(Ie=>Reflect.apply(YV,null,[Ie,...de]),()=>tO(...de),"datetime format",Ie=>Reflect.apply(Ie.d,Ie,[...de]),()=>BE,Ie=>_t(Ie)||jr(Ie))}function ke(...de){return Q(Ie=>Reflect.apply(XV,null,[Ie,...de]),()=>nO(...de),"number format",Ie=>Reflect.apply(Ie.n,Ie,[...de]),()=>BE,Ie=>_t(Ie)||jr(Ie))}function Re(de){return de.map(Ie=>_t(Ie)||hi(Ie)||Bn(Ie)?QV(String(Ie)):Ie)}const be={normalize:Re,interpolate:de=>de,type:"vnode"};function fe(...de){return Q(Ie=>{let it;const Y=Ie;try{Y.processor=be,it=Reflect.apply(JV,null,[Y,...de])}finally{Y.processor=null}return it},()=>rO(...de),"translate",Ie=>Ie[iO](...de),Ie=>[QV(Ie)],Ie=>jr(Ie))}function Le(...de){return Q(Ie=>Reflect.apply(XV,null,[Ie,...de]),()=>nO(...de),"number format",Ie=>Ie[aO](...de),eU,Ie=>_t(Ie)||jr(Ie))}function Ce(...de){return Q(Ie=>Reflect.apply(YV,null,[Ie,...de]),()=>tO(...de),"datetime format",Ie=>Ie[oO](...de),eU,Ie=>_t(Ie)||jr(Ie))}function Ue(de){T=de,C.pluralRules=T}function Be(de,Ie){return Q(()=>{if(!de)return!1;const it=_t(Ie)?Ie:s.value,Y=_t(Ie)?[it]:eO(C,l.value,it);for(let D=0;D[de],"translate exists",it=>Reflect.apply(it.te,it,[de,Ie]),Qye,it=>Bn(it))}function Xe(de){let Ie=null;const it=eO(C,l.value,s.value);for(let Y=0;Y{a&&(s.value=de,C.locale=de,i0(C,s.value,l.value))}),et(t.fallbackLocale,de=>{a&&(l.value=de,C.fallbackLocale=de,i0(C,s.value,l.value))}));const ze={id:tU,locale:L,fallbackLocale:O,get inheritLocale(){return a},set inheritLocale(de){a=de,de&&t&&(s.value=t.locale.value,l.value=t.fallbackLocale.value,i0(C,s.value,l.value))},get availableLocales(){return Object.keys(u.value).sort()},messages:M,get modifiers(){return x},get pluralRules(){return T||{}},get isGlobal(){return r},get missingWarn(){return h},set missingWarn(de){h=de,C.missingWarn=h},get fallbackWarn(){return d},set fallbackWarn(de){d=de,C.fallbackWarn=d},get fallbackRoot(){return p},set fallbackRoot(de){p=de},get fallbackFormat(){return v},set fallbackFormat(de){v=de,C.fallbackFormat=v},get warnHtmlMessage(){return S},set warnHtmlMessage(de){S=de,C.warnHtmlMessage=de},get escapeParameter(){return w},set escapeParameter(de){w=de,C.escapeParameter=de},t:ne,getLocaleMessage:ie,setLocaleMessage:ge,mergeLocaleMessage:Te,getPostTranslationHandler:X,setPostTranslationHandler:$,getMissingHandler:W,setMissingHandler:G,[XX]:Ue};return ze.datetimeFormats=F,ze.numberFormats=U,ze.rt=re,ze.te=Be,ze.tm=J,ze.d=pe,ze.n=ke,ze.getDateTimeFormat=Oe,ze.setDateTimeFormat=Z,ze.mergeDateTimeFormat=oe,ze.getNumberFormat=ve,ze.setNumberFormat=xe,ze.mergeNumberFormat=Pe,ze[KX]=n,ze[iO]=fe,ze[oO]=Ce,ze[aO]=Le,ze}function e0e(e){const t=_t(e.locale)?e.locale:C1,n=_t(e.fallbackLocale)||jr(e.fallbackLocale)||Dn(e.fallbackLocale)||e.fallbackLocale===!1?e.fallbackLocale:t,r=Ar(e.missing)?e.missing:void 0,i=Bn(e.silentTranslationWarn)||cm(e.silentTranslationWarn)?!e.silentTranslationWarn:!0,o=Bn(e.silentFallbackWarn)||cm(e.silentFallbackWarn)?!e.silentFallbackWarn:!0,a=Bn(e.fallbackRoot)?e.fallbackRoot:!0,s=!!e.formatFallbackMessages,l=Dn(e.modifiers)?e.modifiers:{},u=e.pluralizationRules,c=Ar(e.postTranslation)?e.postTranslation:void 0,f=_t(e.warnHtmlInMessage)?e.warnHtmlInMessage!=="off":!0,h=!!e.escapeParameterHtml,d=Bn(e.sync)?e.sync:!0;let p=e.messages;if(Dn(e.sharedMessages)){const x=e.sharedMessages;p=Object.keys(x).reduce((C,P)=>{const k=C[P]||(C[P]={});return pi(k,x[P]),C},p||{})}const{__i18n:v,__root:y,__injectWithOption:m}=e,b=e.datetimeFormats,S=e.numberFormats,w=e.flatJson;return{locale:t,fallbackLocale:n,messages:p,flatJson:w,datetimeFormats:b,numberFormats:S,missing:r,missingWarn:i,fallbackWarn:o,fallbackRoot:a,fallbackFormat:s,modifiers:l,pluralRules:u,postTranslation:c,warnHtmlMessage:f,escapeParameter:h,messageResolver:e.messageResolver,inheritLocale:d,__i18n:v,__root:y,__injectWithOption:m}}function sO(e={}){const t=VE(e0e(e)),{__extender:n}=e,r={id:t.id,get locale(){return t.locale.value},set locale(i){t.locale.value=i},get fallbackLocale(){return t.fallbackLocale.value},set fallbackLocale(i){t.fallbackLocale.value=i},get messages(){return t.messages.value},get datetimeFormats(){return t.datetimeFormats.value},get numberFormats(){return t.numberFormats.value},get availableLocales(){return t.availableLocales},get missing(){return t.getMissingHandler()},set missing(i){t.setMissingHandler(i)},get silentTranslationWarn(){return Bn(t.missingWarn)?!t.missingWarn:t.missingWarn},set silentTranslationWarn(i){t.missingWarn=Bn(i)?!i:i},get silentFallbackWarn(){return Bn(t.fallbackWarn)?!t.fallbackWarn:t.fallbackWarn},set silentFallbackWarn(i){t.fallbackWarn=Bn(i)?!i:i},get modifiers(){return t.modifiers},get formatFallbackMessages(){return t.fallbackFormat},set formatFallbackMessages(i){t.fallbackFormat=i},get postTranslation(){return t.getPostTranslationHandler()},set postTranslation(i){t.setPostTranslationHandler(i)},get sync(){return t.inheritLocale},set sync(i){t.inheritLocale=i},get warnHtmlInMessage(){return t.warnHtmlMessage?"warn":"off"},set warnHtmlInMessage(i){t.warnHtmlMessage=i!=="off"},get escapeParameterHtml(){return t.escapeParameter},set escapeParameterHtml(i){t.escapeParameter=i},get pluralizationRules(){return t.pluralRules||{}},__composer:t,t(...i){return Reflect.apply(t.t,t,[...i])},rt(...i){return Reflect.apply(t.rt,t,[...i])},te(i,o){return t.te(i,o)},tm(i){return t.tm(i)},getLocaleMessage(i){return t.getLocaleMessage(i)},setLocaleMessage(i,o){t.setLocaleMessage(i,o)},mergeLocaleMessage(i,o){t.mergeLocaleMessage(i,o)},d(...i){return Reflect.apply(t.d,t,[...i])},getDateTimeFormat(i){return t.getDateTimeFormat(i)},setDateTimeFormat(i,o){t.setDateTimeFormat(i,o)},mergeDateTimeFormat(i,o){t.mergeDateTimeFormat(i,o)},n(...i){return Reflect.apply(t.n,t,[...i])},getNumberFormat(i){return t.getNumberFormat(i)},setNumberFormat(i,o){t.setNumberFormat(i,o)},mergeNumberFormat(i,o){t.mergeNumberFormat(i,o)}};return r.__extender=n,r}function t0e(e,t,n){return{beforeCreate(){const r=A1();if(!r)throw Ia(Qo.UNEXPECTED_ERROR);const i=this.$options;if(i.i18n){const o=i.i18n;if(i.__i18n&&(o.__i18n=i.__i18n),o.__root=t,this===this.$root)this.$i18n=rU(e,o);else{o.__injectWithOption=!0,o.__extender=n.__vueI18nExtend,this.$i18n=sO(o);const a=this.$i18n;a.__extender&&(a.__disposer=a.__extender(this.$i18n))}}else if(i.__i18n)if(this===this.$root)this.$i18n=rU(e,i);else{this.$i18n=sO({__i18n:i.__i18n,__injectWithOption:!0,__extender:n.__vueI18nExtend,__root:t});const o=this.$i18n;o.__extender&&(o.__disposer=o.__extender(this.$i18n))}else this.$i18n=e;i.__i18nGlobal&&JX(t,i,i),this.$t=(...o)=>this.$i18n.t(...o),this.$rt=(...o)=>this.$i18n.rt(...o),this.$te=(o,a)=>this.$i18n.te(o,a),this.$d=(...o)=>this.$i18n.d(...o),this.$n=(...o)=>this.$i18n.n(...o),this.$tm=o=>this.$i18n.tm(o),n.__setInstance(r,this.$i18n)},mounted(){},unmounted(){const r=A1();if(!r)throw Ia(Qo.UNEXPECTED_ERROR);const i=this.$i18n;delete this.$t,delete this.$rt,delete this.$te,delete this.$d,delete this.$n,delete this.$tm,i.__disposer&&(i.__disposer(),delete i.__disposer,delete i.__extender),n.__deleteInstance(r),delete this.$i18n}}}function rU(e,t){e.locale=t.locale||e.locale,e.fallbackLocale=t.fallbackLocale||e.fallbackLocale,e.missing=t.missing||e.missing,e.silentTranslationWarn=t.silentTranslationWarn||e.silentFallbackWarn,e.silentFallbackWarn=t.silentFallbackWarn||e.silentFallbackWarn,e.formatFallbackMessages=t.formatFallbackMessages||e.formatFallbackMessages,e.postTranslation=t.postTranslation||e.postTranslation,e.warnHtmlInMessage=t.warnHtmlInMessage||e.warnHtmlInMessage,e.escapeParameterHtml=t.escapeParameterHtml||e.escapeParameterHtml,e.sync=t.sync||e.sync,e.__composer[XX](t.pluralizationRules||e.pluralizationRules);const n=DM(e.locale,{messages:t.messages,__i18n:t.__i18n});return Object.keys(n).forEach(r=>e.mergeLocaleMessage(r,n[r])),t.datetimeFormats&&Object.keys(t.datetimeFormats).forEach(r=>e.mergeDateTimeFormat(r,t.datetimeFormats[r])),t.numberFormats&&Object.keys(t.numberFormats).forEach(r=>e.mergeNumberFormat(r,t.numberFormats[r])),e}const OM={tag:{type:[String,Object]},locale:{type:String},scope:{type:String,validator:e=>e==="parent"||e==="global",default:"parent"},i18n:{type:Object}};function n0e({slots:e},t){return t.length===1&&t[0]==="default"?(e.default?e.default():[]).reduce((r,i)=>[...r,...i.type===$e?i.children:[i]],[]):t.reduce((n,r)=>{const i=e[r];return i&&(n[r]=i()),n},cr())}function QX(){return $e}const r0e=Ye({name:"i18n-t",props:pi({keypath:{type:String,required:!0},plural:{type:[Number,String],validator:e=>hi(e)||!isNaN(e)}},OM),setup(e,t){const{slots:n,attrs:r}=t,i=e.i18n||wn({useScope:e.scope,__useComponent:!0});return()=>{const o=()=>{const l=Object.keys(n).filter(f=>f[0]!=="_"),u=cr();e.locale&&(u.locale=e.locale),e.plural!==void 0&&(u.plural=_t(e.plural)?+e.plural:e.plural);const c=n0e(t,l);return i[iO](e.keypath,c,u)},a=pi(cr(),r),s=_t(e.tag)||Un(e.tag)?e.tag:QX();return Un(s)?Wn(s,a,{default:o}):Wn(s,a,o())}}}),iU=r0e;function i0e(e){return jr(e)&&!_t(e[0])}function qX(e,t,n,r){const{slots:i,attrs:o}=t;return()=>{const a=()=>{const u={part:!0};let c=cr();e.locale&&(u.locale=e.locale),_t(e.format)?u.key=e.format:Un(e.format)&&(_t(e.format.key)&&(u.key=e.format.key),c=Object.keys(e.format).reduce((d,p)=>n.includes(p)?pi(cr(),d,{[p]:e.format[p]}):d,cr()));const f=r(e.value,u,c);let h=[u.key];return jr(f)?h=f.map((d,p)=>{const v=i[d.type],y=v?v({[d.type]:d.value,index:p,parts:f}):[d.value];return i0e(y)&&(y[0].key=`${d.type}-${p}`),y}):_t(f)&&(h=[f]),h},s=pi(cr(),o),l=_t(e.tag)||Un(e.tag)?e.tag:QX();return Un(l)?Wn(l,s,{default:a}):Wn(l,s,a())}}const o0e=Ye({name:"i18n-n",props:pi({value:{type:Number,required:!0},format:{type:[String,Object]}},OM),setup(e,t){const n=e.i18n||wn({useScope:e.scope,__useComponent:!0});return qX(e,t,zX,(...r)=>n[aO](...r))}}),oU=o0e;function a0e(e,t){const n=e;if(e.mode==="composition")return n.__getInstance(t)||e.global;{const r=n.__getInstance(t);return r!=null?r.__composer:e.global.__composer}}function s0e(e){const t=a=>{const{instance:s,value:l}=a;if(!s||!s.$)throw Ia(Qo.UNEXPECTED_ERROR);const u=a0e(e,s.$),c=aU(l);return[Reflect.apply(u.t,u,[...sU(c)]),u]};return{created:(a,s)=>{const[l,u]=t(s);$E&&(a.__i18nWatcher=et(u.locale,()=>{s.instance&&s.instance.$forceUpdate()})),a.__composer=u,a.textContent=l},unmounted:a=>{$E&&a.__i18nWatcher&&(a.__i18nWatcher(),a.__i18nWatcher=void 0,delete a.__i18nWatcher),a.__composer&&(a.__composer=void 0,delete a.__composer)},beforeUpdate:(a,{value:s})=>{if(a.__composer){const l=a.__composer,u=aU(s);a.textContent=Reflect.apply(l.t,l,[...sU(u)])}},getSSRProps:a=>{const[s]=t(a);return{textContent:s}}}}function aU(e){if(_t(e))return{path:e};if(Dn(e)){if(!("path"in e))throw Ia(Qo.REQUIRED_VALUE,"path");return e}else throw Ia(Qo.INVALID_VALUE)}function sU(e){const{path:t,locale:n,args:r,choice:i,plural:o}=e,a={},s=r||{};return _t(n)&&(a.locale=n),hi(i)&&(a.plural=i),hi(o)&&(a.plural=o),[t,s,a]}function l0e(e,t,...n){const r=Dn(n[0])?n[0]:{};(!Bn(r.globalInstall)||r.globalInstall)&&([iU.name,"I18nT"].forEach(o=>e.component(o,iU)),[oU.name,"I18nN"].forEach(o=>e.component(o,oU)),[cU.name,"I18nD"].forEach(o=>e.component(o,cU))),e.directive("t",s0e(t))}const u0e=xd("global-vue-i18n");function c0e(e={}){const t=__VUE_I18N_LEGACY_API__&&Bn(e.legacy)?e.legacy:__VUE_I18N_LEGACY_API__,n=Bn(e.globalInjection)?e.globalInjection:!0,r=new Map,[i,o]=f0e(e,t),a=xd("");function s(f){return r.get(f)||null}function l(f,h){r.set(f,h)}function u(f){r.delete(f)}const c={get mode(){return __VUE_I18N_LEGACY_API__&&t?"legacy":"composition"},async install(f,...h){if(f.__VUE_I18N_SYMBOL__=a,f.provide(f.__VUE_I18N_SYMBOL__,c),Dn(h[0])){const v=h[0];c.__composerExtend=v.__composerExtend,c.__vueI18nExtend=v.__vueI18nExtend}let d=null;!t&&n&&(d=y0e(f,c.global)),__VUE_I18N_FULL_INSTALL__&&l0e(f,c,...h),__VUE_I18N_LEGACY_API__&&t&&f.mixin(t0e(o,o.__composer,c));const p=f.unmount;f.unmount=()=>{d&&d(),c.dispose(),p()}},get global(){return o},dispose(){i.stop()},__instances:r,__getInstance:s,__setInstance:l,__deleteInstance:u};return c}function wn(e={}){const t=A1();if(t==null)throw Ia(Qo.MUST_BE_CALL_SETUP_TOP);if(!t.isCE&&t.appContext.app!=null&&!t.appContext.app.__VUE_I18N_SYMBOL__)throw Ia(Qo.NOT_INSTALLED);const n=d0e(t),r=p0e(n),i=ZX(t),o=h0e(e,i);if(o==="global")return JX(r,e,i),r;if(o==="parent"){let l=lU(n,t,e.__useComponent);return l==null&&(l=r),l}if(o==="isolated"){if(n.mode!=="composition")throw Ia(Qo.NOT_AVAILABLE_COMPOSITION_IN_LEGACY);const l=n,u=pi({},e),c=lU(n,t);u.__root=c||r;const f=VE(u);return l.__composerExtend&&(f[hg]=l.__composerExtend(f)),A_()&&R_(()=>{const d=f[hg];d&&(d(),delete f[hg])}),f}const a=n;let s=a.__getInstance(t);if(s==null){const l=pi({},e);"__i18n"in i&&(l.__i18n=i.__i18n),r&&(l.__root=r),s=VE(l),a.__composerExtend&&(s[hg]=a.__composerExtend(s)),g0e(a,t,s),a.__setInstance(t,s)}return s}function f0e(e,t){const n=q7(),r=__VUE_I18N_LEGACY_API__&&t?n.run(()=>sO(e)):n.run(()=>VE(e));if(r==null)throw Ia(Qo.UNEXPECTED_ERROR);return[n,r]}function d0e(e){const t=Zo(e.isCE?u0e:e.appContext.app.__VUE_I18N_SYMBOL__);if(!t)throw Ia(e.isCE?Qo.NOT_INSTALLED_WITH_PROVIDE:Qo.UNEXPECTED_ERROR);return t}function h0e(e,t){return RI(e)?"__i18n"in t?"local":"global":e.useScope?e.useScope:"local"}function p0e(e){return e.mode==="composition"?e.global:e.global.__composer}function lU(e,t,n=!1){let r=null;const i=t.root;let o=v0e(t,n);for(;o!=null;){const a=e;if(e.mode==="composition")r=a.__getInstance(o);else if(__VUE_I18N_LEGACY_API__){const s=a.__getInstance(o);s!=null&&(r=s.__composer,n&&r&&!r[KX]&&(r=null))}if(r!=null||i===o)break;o=o.parent}return r}function v0e(e,t=!1){return e==null?null:t&&e.vnode.ctx||e.parent}function g0e(e,t,n){Sr(()=>{},t),Do(()=>{const r=n;e.__deleteInstance(t);const i=r[hg];i&&(i(),delete r[hg])},t)}const m0e=["locale","fallbackLocale","availableLocales"],uU=["t","rt","d","n","tm","te"];function y0e(e,t){const n=Object.create(null);return m0e.forEach(i=>{const o=Object.getOwnPropertyDescriptor(t,i);if(!o)throw Ia(Qo.UNEXPECTED_ERROR);const a=st(o.value)?{get(){return o.value.value},set(s){o.value.value=s}}:{get(){return o.get&&o.get()}};Object.defineProperty(n,i,a)}),e.config.globalProperties.$i18n=n,uU.forEach(i=>{const o=Object.getOwnPropertyDescriptor(t,i);if(!o||!o.value)throw Ia(Qo.UNEXPECTED_ERROR);Object.defineProperty(e.config.globalProperties,`$${i}`,o)}),()=>{delete e.config.globalProperties.$i18n,uU.forEach(i=>{delete e.config.globalProperties[`$${i}`]})}}const b0e=Ye({name:"i18n-d",props:pi({value:{type:[Number,Date],required:!0},format:{type:[String,Object]}},OM),setup(e,t){const n=e.i18n||wn({useScope:e.scope,__useComponent:!0});return qX(e,t,WX,(...r)=>n[oO](...r))}}),cU=b0e;Jye();kye(fye);Pye(Iye);Dye(eO);if(__INTLIFY_PROD_DEVTOOLS__){const e=Gh();e.__INTLIFY__=!0,dye(e.__INTLIFY_DEVTOOLS_GLOBAL_HOOK__)}const _0e={setup:"Setup",overview:"Overview",proxies:"Proxies",rules:"Rules",connections:"Connections",logs:"Logs",tools:"Tools",tailscale:"Tailscale",terminal:"Terminal",default:"Default",backendType:"Backend Type",clashApi:"Clash API",singboxApi:"sing-box API",singboxConnectionFailed:"Failed to connect to the sing-box native API",skip:"Skip",networkQuality:"Network Quality",stunTest:"STUN Test",startTest:"Start test",cancelTest:"Cancel test",serverField:"Server",externalAddress:"External address",natMapping:"NAT mapping",natFiltering:"NAT filtering",natTypeDetection:"NAT type detection",idleLatency:"Idle latency",downloadRPM:"Download RPM",uploadRPM:"Upload RPM",elapsed:"Elapsed",results:"Results",http3:"HTTP/3",maxRuntime:"Max runtime",startTime:"Start time",notSupportedByServer:"Not supported by server",configURL:"Configuration URL",serial:"Serial",accuracyHigh:"High",accuracyMedium:"Medium",accuracyLow:"Low",fetchingConfiguration:"Fetching configuration...",binding:"Binding...",exitNode:"Exit node",ping:"Ping",logout:"Logout",online:"Online",offline:"Offline",peers:"Peers",noEndpoints:"No Tailscale endpoints",backendState:"State",statusLabel:"Status",thisDevice:"This device",networkLabel:"Network",expired:"Expired",connectViaSSH:"Connect via SSH",disabledLabel:"Disabled",directConnection:"Direct connection",derpRelayed:"DERP-relayed connection",sharedIn:"Shared in",addresses:"Addresses",hostnameLabel:"Hostname",osLabel:"OS",keyExpiry:"Key expiry",lastSeen:"Last seen",detailsLabel:"Details",authURL:"Auth URL",showAuthQR:"Show auth URL QR code",derpRegion:"DERP region",endpointLabel:"Endpoint",activeLabel:"Active",availableLabel:"Available",dragOrClickToAdd:"Drag or click to add",addRow:"Add row",sshConfiguration:"SSH Configuration",terminalType:"Terminal type",rememberSSHOptions:"Remember SSH options",editSSHConfiguration:"Edit SSH Configuration",connected:"Connected",notConnected:"Not connected",copy:"Copy",yes:"Yes",peer:"Peer",username:"Username",connect:"Connect",sessionClosed:"Session closed",newSession:"New Session",paste:"Paste",terminalKeys:"Terminal keys",peerNotFound:"Peer not found",connecting:"Connecting...",disconnect:"Disconnect",sessionExited:"Session exited with code {code}",signalSuffix:"(signal {signal})",streamEnded:"Stream ended with status {code}",terminalSettings:"Terminal Settings",terminalThemeLight:"Theme (Light)",terminalThemeDark:"Theme (Dark)",fontFamily:"Font Family",fontSize:"Font Size",defaultFont:"Default",usbip:"USB/IP",usbipNoServer:"No usbip-server found",usbipServerTagged:"USB/IP: {tag}",usbipDevices:"Devices",usbipConnectDevice:"Connect device",usbipAuthorizedDevices:"Authorized devices",usbipOtherDevice:"Other device…",usbipDetach:"Detach",usbipPickDeviceHint:"Pick a USB device to share it through this usbip-server.",usbipNoDevicesShared:"No devices shared yet.",usbipInsecureContext:"WebUSB requires a secure context. Open the dashboard via localhost or over HTTPS.",usbipUnsupportedBrowser:"To provide devices, use a Chromium-based browser with the dashboard, or the sing-box graphical client on macOS or Android.",usbipClaimBlockedClass:"Can't share “{label}”: the browser blocks sharing this device's interface class (such as HID, storage, audio or video).",usbipClaimBlockedBusy:"Can't share “{label}”: another program or driver is using it. Close anything using the device, then try again.",usbipStateAttaching:"Attaching...",usbipStateReady:"Ready",usbipStateError:"Error",usbipStateIdle:"Idle",usbipStateAttached:"Attached",usbipStateUnavailable:"Unavailable",usbipIdentity:"Identity",usbipProduct:"Product",usbipSerialNumber:"Serial number",usbipVersion:"Version",usbipConnection:"Connection",usbipBusId:"Bus ID",usbipBackend:"Backend",usbipSpeed:"Speed",usbipBusDevice:"Bus / Device",usbipClassInterfaces:"Class & Interfaces",usbipDeviceClass:"Device class",usbipDefinedAtInterface:"Defined at interface level",usbipConfigurations:"Configurations",usbipInterfaceN:"Interface {n}",protocol:"Protocol",host:"Host",port:"Port",password:"Password",submit:"Submit",cancel:"Cancel",delete:"Delete",download:"Download",upload:"Upload",downloadSpeed:"Download speed",uploadSpeed:"Upload speed",memoryUsage:"Memory usage",goroutines:"Goroutines",noData:"No data",flushFakeIP:"Flush fake IP",flushDNSCache:"Flush DNS cache",flushDNSCacheSuccess:"DNS cache flushed successfully",flushFakeIPSuccess:"Fake IP flushed successfully",flushSmartWeightsSuccess:"Smart weights flushed successfully",restartCoreSuccess:"Core restarted successfully",reloadConfigsSuccess:"Configs reloaded successfully",updateGeoSuccess:"Geo database updated successfully",chains:"Chains",outbound:"Outbound",sortBy:"Sort by",rule:"Rule",sourceIP:"Source IP",activeConnections:"Active",closedConnections:"Closed",logLevel:"Log level",logType:"Log type",twoColumnProxyGroup:"Two-column proxy groups",type:"Type",process:"Process",connectTime:"Connect time",sourcePort:"Source port",destination:"Resolved address",destinationType:"Resolved type",geoip:"GeoIP",geoipCountryDatabaseURL:"GeoIP country database URL",geoipASNDatabaseURL:"GeoIP ASN database URL",geoipDatabaseURLTip:"Used to resolve the GeoIP info (country / ASN) of connection IPs locally. The mmdb is loaded from this URL and cached in the browser. Leave empty to use the default.",inboundUser:"Inbound user",outboundType:"Outbound type",fromOutbound:"From outbound",basic:"Basic",traffic:"Traffic",sourceAndDestination:"Source & destination",rawData:"Raw",geoInfo:"GeoIP",dl:"DL",ul:"UL",dlSpeed:"DL speed",ulSpeed:"UL speed",settings:"Settings",speedtestUrl:"Speedtest URL",speedtestTimeout:"Speedtest timeout",speedtestMode:"Speedtest mode",speedtestModeDashboard:"Dashboard controlled",speedtestModeCore:"Core controlled",speedtestModeTip:"Dashboard controlled keeps Selector, LoadBalance, and Smart groups on the dashboard-driven per-node test flow and shows per-node progress. Core controlled calls the core group latency API and lets the core test the whole group at once.",connectionStyle:"Connection style",card:"Card",table:"Table",customTableColumns:"Custom table columns",customCardLines:"Custom card lines",close:"Close",appearance:"Appearance",defaultTheme:"Default theme",darkTheme:"Dark theme",proxyProvider:"Proxy provider",ruleProvider:"Rule provider",expire:"Expires",noExpire:"No expiry",updated:"Updated",upgradeDashboard:"Upgrade dashboard",reloadConfigs:"Reload configs",updateConfigs:"Update configs",updateConfigsSuccess:"Configs updated successfully",configFilePath:"Config file path",configFilePathPlaceholder:"Absolute path, e.g. /etc/mihomo/config.yaml",configPayload:"Config content",configPayloadPlaceholder:"Paste YAML config content here...",forceUpdate:"Force update",or:"or",defaultsort:"Config order",nameasc:"Name ascending",namedesc:"Name descending",latencydesc:"Latency descending",latencyasc:"Latency ascending",language:"Language",automaticDisconnection:"Auto disconnect on node switch",backend:"Backend",tunMode:"TUN mode",upgradeCore:"Upgrade core",upgradeToRelease:"Upgrade to stable release",upgradeToAlpha:"Upgrade to alpha release",updateGeoDatabase:"Update GEO database",truncateProxyName:"Truncate proxy name",disableProxiesPageTextSelect:"Disable text selection on proxies page",sourceIPLabels:"Source IP labels",proxyPreviewType:"Proxy preview type",auto:"Auto",dots:"Dots",bar:"Bar",exportSettings:"Export settings",importSettings:"Import settings",dashboardSettings:"Dashboard settings",dashboardSettingsCore:"Core",dashboardSettingsJsonFile:"JSON file",dashboardSettingsUrl:"URL",autoSyncSettings:"Auto-sync settings",uploadSettings:"Upload settings to core",syncSettings:"Sync settings from core",deleteUploadedSettings:"Delete uploaded settings from core",connectionSettings:"Connection settings",proxySettings:"Proxy settings",logSettings:"Log settings",ruleSettings:"Rule settings",connectionDetails:"Connection details",customTheme:"Custom theme",unavailableProxy:"Hide unavailable proxies",protocolTips:"You are trying to connect to an HTTP backend, but zashboard is provided via HTTPS. This may cause connection errors. Please allow insecure content in your browser settings or use the HTTP version of zashboard, such as http://board.zash.run.place.",global:"Global",direct:"Direct",lowLatencyDesc:"Yellow threshold",mediumLatencyDesc:"Red threshold",fonts:"Fonts",emoji:"Emoji",unauthorizedTip:"Unauthorized, please log in again.",restartCore:"Restart core",checkCoreUpgrade:"Check for core upgrades",autoUpgradeDashboard:"Auto-upgrade dashboard",autoUpgradeCore:"Auto-upgrade core",secondaryPath:"Secondary path",secondaryPathTip:'If present, start with "/", otherwise leave empty.',logRetentionLimit:"Log retention limit",DNSQuery:"DNS query",currentBackendUnavailable:"The current backend is unavailable. Would you like to switch to another backend?",confirm:"Confirm",backendSwitchTo:"Switched backend to {backend}",ipv6Test:"IPv6 test",socksPort:"SOCKS port",httpPort:"HTTP port",mixedPort:"Mixed port",redirPort:"Redir port",tproxyPort:"TProxy port",tableSize:"Table size",proxyCardSize:"Proxy card size",small:"Small",normal:"Normal",large:"Large",autoIPCheckWhenStart:"Auto-check IP on startup",autoConnectionCheckWhenStart:"Auto-check connections on startup",networkInfo:"Network info",autoSwitchTheme:"Auto-switch theme",customBackgroundURL:"Background",splitOverviewPage:"Split overview page",manageHiddenGroup:"Manage hidden groups",transparent:"Transparency",proxyGroupIconSize:"Proxy group icon size",proxyGroupIconMargin:"Proxy group icon margin",allowLan:"Allow LAN",proxyChainDirection:"Proxy chain direction",showFullProxyChain:"Show full proxy chain",reverse:"Reverse",sniffHost:"Sniff host",ipScreenshotTip:"Please hide the IP when taking screenshots.",showStatisticsWhenSidebarCollapsed:"Show statistics when the sidebar is collapsed",totalConnections:"Connection statistics",totalConnectionsTip:`Only connections opened while the dashboard is open are counted. +Tracking started at: {statsStartTime}`,manual:"Manual",tableWidthMode:"Table width mode",testFailed:"Test failed",testFinishedTip:`{name} +{number}/{total} tests completed`,testFinishedResultTip:`{name} +Test completed: {success} succeeded, {failed} timed out`,testFailedTip:`{name} +Test failed`,updateFinishedTip:"{number} update(s) finished",independentLatencyTest:"Independent latency test",independentLatencyTestTip:"When enabled, the latency test will use URLs specified in the configuration file instead of zashboard's URL settings. Latency will be displayed independently based on the URLs set in policy groups.",search:"Search",searchProxyGroup:"Search proxy groups",searchProxyNode:"Search proxy nodes",proxySearchModeGlobal:"Node search",proxySearchModeGroup:"Policy group search",importing:"Importing...",hideConnection:"Hide connection",showConnection:"Show connection",hideConnectionRegex:"Hide connection regex",hideConnectionTip:"You can use case-insensitive regular expressions to match and hide unwanted connections.",hideLog:"Hide log",showLog:"Show log",hideLogRegex:"Hide log regex",hideLogTip:"You can use case-insensitive regular expressions to match and hide unwanted logs.",sameConnectionLogs:"Logs of the same connection",loadBalance:"Load balancing",label:"Label",optional:"Optional",swipeInTabs:"Swipe to switch between tabs",swipeInPages:"Swipe to switch between pages",simpleCardPreset:"Simple preset",detailedCardPreset:"Detailed preset",refresh:"Refresh",reset:"Reset",resetSettings:"Reset settings",resetSettingsConfirm:"Are you sure you want to reset all dashboard settings to default values? This action cannot be undone.",backgroundToneSwitchConfirm:"This background looks better with the {theme}. Do you want to switch?",backgroundToneLightThemeLabel:"light theme",backgroundToneDarkThemeLabel:"dark theme",minProxyCardWidth:"Minimum proxy card width",displayGlobalByMode:"Show GLOBAL based on mode",displaySelectedNode:"Show selected node",displayLatencyNumber:"Show latency numbers",disconnectOnRuleDisable:"Disconnect matching connections when a rule is disabled",tipForFixed:"The current policy group is locked to the current node. Run a speed test to restore {type} behavior.",remoteAddress:"Remote address",save:"Save",moreDetails:"More details",moreSettings:"More settings",customIcon:"Custom icon",dropOrClickUpload:"Drop an image or paste a URL",disablePullToRefresh:"Disable pull to refresh",disablePullToRefreshTip:"Pull-to-refresh and virtual scrolling components may conflict. If you experience lag or accidentally trigger pull-to-refresh while scrolling, try disabling this feature.",keyboardShortcuts:"Keyboard shortcuts",keyboardShortcutsTip:"Click the input and press a key or key combination to set a shortcut. Press Backspace or Delete to clear it.",keyboardShortcutPageName:"{name} page",toggleSidebar:"Toggle sidebar",switchToPreviousBackend:"Switch to previous backend",switchToNextBackend:"Switch to next backend",openBackendSettings:"Open backend settings",keyboardShortcutsConflict:"Duplicate shortcuts detected: {keys}. Only the first one will take effect.",resetKeyboardShortcuts:"Reset shortcuts",pressAnyKey:"Press a key",displayAllFeatures:"Show all features",displayAllFeaturesTip:"Show all features, including those not supported by the official sing-box version. If you're using a forked version of sing-box that supports some of these features, you can try enabling them.",blurIntensity:"Blur intensity",scrollAnimationEffect:"Scroll animation effect",importFromFile:"Import from file",importFromUrl:"Import from URL",uploadSettingsSuccess:"Settings uploaded successfully",uploadSettingsIconReflectListRemoved:"Custom icon data was too large and has been removed during upload. Please reduce it and try again.",syncSettingsSuccess:"Settings synced successfully",syncSettingsConfirm:`The backend has stored settings that will override the following local settings: + +{keys} + +Do you want to apply them?`,importSettingsConfirm:`The imported settings will override the following local settings: + +{keys} + +Do you want to apply them?`,deleteUploadedSettingsSuccess:"Uploaded settings deleted successfully",deleteUploadedSettingsConfirm:"Are you sure you want to delete the uploaded settings on the backend? This action cannot be undone.",upgradeSuccess:"Upgrade successful",numberOfChartsInSidebar:"Number of charts in the sidebar",flushSmartWeights:"Clear smart weights",IPInfoAPI:"IP info API",IPInfoAPITip:"This API is used to look up global node IP information during IP checks, and for IP geolocation lookups in connection details and zashboard's DNS query feature.",general:"General",groupProxiesByProvider:"Group proxies by provider",useSmartGroupSort:"Sort smart groups by usage frequency",all:"All",autoDisconnectIdleUDP:"Auto-disconnect idle UDP connections",autoDisconnectIdleUDPTime:"UDP idle time",autoDisconnectIdleUDPTip:"When enabled, opening zashboard will close UDP connections that have been idle longer than the configured time. This can help with UDP connections that don't disconnect automatically.",customGlobalNode:"Custom global node",connectionTopology:"Connection topology",editBackend:"Edit backend",editBackendTitle:"Edit backend configuration",selectBackend:"Select backend",backendConnectionFailed:"Backend connection failed. Please check your configuration.",backendConfigSaved:"Backend configuration saved successfully",saveFailed:"Save failed",checking:"Checking...",copySuccess:"Copied successfully",importFromBackendTip:"The default ./zashboard-settings.json is located in the ui folder. Please ensure the ui folder exists and contains the configuration file.",importFailed:"Import failed, please check the URL: {url}",autoImportFromUrl:"Auto-import",autoImportFromUrlTip:"When enabled, settings will be automatically imported from the URL when opening zashboard. If the hash differs from the last imported hash, settings will be re-imported and the page will be refreshed.",getting:"Getting...",mmdbSizeTip:"If you are using MMDB-format GEO files, this number will be 0.",displayFinalOutbound:"Show final outbound node",groupTestUrls:"Group test URLs",groupTestUrlsTip:"For manual tests triggered from the dashboard, URL priority is: URLs set here > URLs in configuration > global test URLs. For groups like UrlTest/Fallback, you still need to modify URLs in the configuration, so this is mainly recommended for Selector scenarios.",groupName:"Group name",unknown:"Unknown",sourceIPAddress:"Source IP address",ruleMatch:"Rule match",proxyChainEntry:"Proxy chain entry",proxyChainExit:"Proxy chain exit",nodeType:"Node type",connectionCount:"Connection count",zashboardSettings:"Dashboard settings",backendSettings:"Backend settings",generalSettings:"General settings",overviewSettings:"Overview settings",overviewCardSettings:"Card settings",chartsCard:"Charts card",networkCard:"Network card",providerTrafficOverview:"Provider traffic overview",topologyCharts:"Topology charts",connectionHistory:"Connection history",ruleHitCountCard:"Rule hit/miss statistics",latency:"Latency",icon:"Icon",settingsVisibility:"Settings visibility",settingsMenuGeneral:"General",settingsMenuBackend:"Backend",settingsMenuProxies:"Proxies",settingsMenuConnections:"Connections",settingsMenuOverview:"Overview",ports:"Ports",actions:"Actions",showAllPreset:"Show all",minimalPreset:"Minimal view",settingsPageTwoColumns:"Two column layout",moveUp:"Move up",moveDown:"Move down",aggregateBy:"Aggregate by",aggregateBySourceIP:"By source IP",aggregateByDestination:"By destination",aggregateByProcess:"By process",aggregateByOutbound:"By outbound",totalTraffic:"Total traffic",total:"Total",clearConnectionHistory:"Clear connection history",clearConnectionHistoryConfirm:"Are you sure you want to clear all connection history data? This action cannot be undone.",clearConnectionHistorySuccess:"Connection history data cleared successfully",autoCleanupInterval:"Auto cleanup interval",autoCleanupIntervalWeek:"Weekly",autoCleanupIntervalMonth:"Monthly",autoCleanupIntervalQuarter:"Quarterly",autoCleanupIntervalNever:"Never",remainingTraffic:"Remaining",ruleHitCount:"Hit: {count} times",ruleLastHit:"Last hit: {time}",ruleMissCount:"Miss: {count} times",ruleLastMiss:"Last miss: {time}",RarelyUsed:"Rarely used",OccasionalUsed:"Occasionally used",MostUsed:"Most used",proxyFolderMode:"Proxy folder mode",folderModeAuto:"Auto",folderModeOn:"On",folderModeOff:"Off",folder_all:"All",folder_uncategorized:"Uncategorized",folder_manage:"Manage folders",folder_builtin_strategy:"Strategy",folder_builtin_nodes:"Nodes",folder_name:"Folder name",folder_new_placeholder:"New folder name",folder_rules:"Auto rules",folder_rule_auto:"Auto",folder_rule_regex:"Regex",folder_rule_exclude_regex:"Exclude regex",folder_auto_hasGroup:"Contains sub-group",folder_auto_nodeOnly:"Nodes only",folder_add_rule:"Add rule",folder_manual_includes:"Manually included",folder_filter_placeholder:"Filter proxy groups",folder_preview:"Auto-matched groups",folder_no_matches:"No matched groups",folder_delete_confirm:'Delete folder "{name}"?'},S0e={setup:"Настройка",overview:"Обзор",proxies:"Прокси",rules:"Правила",connections:"Подключения",logs:"Журнал",tools:"Инструменты",tailscale:"Tailscale",terminal:"Терминал",default:"По умолчанию",backendType:"Тип бэкенда",clashApi:"Clash API",singboxApi:"sing-box API",singboxConnectionFailed:"Не удалось подключиться к нативному API sing-box",skip:"Пропустить",networkQuality:"Качество сети",stunTest:"STUN тест",startTest:"Начать тест",cancelTest:"Отменить тест",serverField:"Сервер",externalAddress:"Внешний адрес",natMapping:"NAT отображение",natFiltering:"NAT фильтрация",natTypeDetection:"Определение типа NAT",idleLatency:"Задержка простоя",downloadRPM:"Загрузка RPM",uploadRPM:"Отдача RPM",elapsed:"Прошло",results:"Результаты",http3:"HTTP/3",maxRuntime:"Макс. время",startTime:"Время запуска",notSupportedByServer:"Не поддерживается сервером",configURL:"URL конфигурации",serial:"Последовательно",accuracyHigh:"Высокая",accuracyMedium:"Средняя",accuracyLow:"Низкая",fetchingConfiguration:"Получение конфигурации...",binding:"Привязка...",exitNode:"Выходной узел",ping:"Ping",logout:"Выйти",online:"В сети",offline:"Не в сети",peers:"Узлы",noEndpoints:"Нет конечных точек Tailscale",backendState:"Состояние",statusLabel:"Состояние",thisDevice:"Это устройство",networkLabel:"Сеть",expired:"Истёк",connectViaSSH:"Подключиться по SSH",disabledLabel:"Отключено",directConnection:"Прямое соединение",derpRelayed:"Соединение через DERP",sharedIn:"Совместный доступ",addresses:"Адреса",hostnameLabel:"Имя хоста",osLabel:"ОС",keyExpiry:"Срок действия ключа",lastSeen:"Последняя активность",detailsLabel:"Подробности",authURL:"URL авторизации",showAuthQR:"Показать QR-код URL авторизации",derpRegion:"Регион DERP",endpointLabel:"Конечная точка",activeLabel:"Активен",availableLabel:"Доступен",dragOrClickToAdd:"Перетащите или нажмите, чтобы добавить",addRow:"Добавить строку",sshConfiguration:"Настройка SSH",terminalType:"Тип терминала",rememberSSHOptions:"Запомнить параметры SSH",editSSHConfiguration:"Изменить настройку SSH",connected:"Подключено",notConnected:"Не подключено",copy:"Копировать",yes:"Да",peer:"Узел",username:"Имя пользователя",connect:"Подключить",sessionClosed:"Сессия закрыта",newSession:"Новая сессия",paste:"Вставить",terminalKeys:"Клавиши терминала",peerNotFound:"Узел не найден",connecting:"Подключение...",disconnect:"Отключить",sessionExited:"Сеанс завершён с кодом {code}",signalSuffix:"(сигнал {signal})",streamEnded:"Поток завершён со статусом {code}",terminalSettings:"Настройки терминала",terminalThemeLight:"Тема (светлая)",terminalThemeDark:"Тема (тёмная)",fontFamily:"Шрифт",fontSize:"Размер шрифта",defaultFont:"По умолчанию",usbip:"USB/IP",usbipNoServer:"usbip-server не найден",usbipServerTagged:"USB/IP: {tag}",usbipDevices:"Устройства",usbipConnectDevice:"Подключить устройство",usbipAuthorizedDevices:"Авторизованные устройства",usbipOtherDevice:"Другое устройство…",usbipDetach:"Отключить",usbipPickDeviceHint:"Выберите USB-устройство для предоставления через этот usbip-server.",usbipNoDevicesShared:"Устройства ещё не предоставлены.",usbipInsecureContext:"WebUSB требует безопасного контекста. Откройте панель через localhost или по HTTPS.",usbipUnsupportedBrowser:"Чтобы предоставлять устройства, используйте браузер на базе Chromium либо графический клиент sing-box на macOS или Android.",usbipClaimBlockedClass:"Не удаётся предоставить «{label}»: браузер блокирует общий доступ к классу интерфейса этого устройства (HID, накопитель, аудио или видео).",usbipClaimBlockedBusy:"Не удаётся предоставить «{label}»: устройство используется другой программой или драйвером. Закройте их и повторите попытку.",usbipStateAttaching:"Подключение...",usbipStateReady:"Готово",usbipStateError:"Ошибка",usbipStateIdle:"Простаивает",usbipStateAttached:"Подключено",usbipStateUnavailable:"Недоступно",usbipIdentity:"Идентификация",usbipProduct:"Продукт",usbipSerialNumber:"Серийный номер",usbipVersion:"Версия",usbipConnection:"Подключение",usbipBusId:"ID шины",usbipBackend:"Бэкенд",usbipSpeed:"Скорость",usbipBusDevice:"Шина / Устройство",usbipClassInterfaces:"Класс и интерфейсы",usbipDeviceClass:"Класс устройства",usbipDefinedAtInterface:"Определяется на уровне интерфейса",usbipConfigurations:"Конфигурации",usbipInterfaceN:"Интерфейс {n}",protocol:"Протокол",host:"Хост",port:"Порт",password:"Пароль",submit:"Отправить",cancel:"Отмена",delete:"Удалить",download:"Загружено",upload:"Отправлено",downloadSpeed:"Скорость загрузки",uploadSpeed:"Скорость отдачи",memoryUsage:"Память",goroutines:"Goroutines",noData:"Нет данных",flushFakeIP:"Очистить Fake IP",flushDNSCache:"Очистить DNS кэш",flushDNSCacheSuccess:"DNS кэш успешно очищен",flushFakeIPSuccess:"Fake IP успешно очищен",flushSmartWeightsSuccess:"Smart веса успешно очищены",restartCoreSuccess:"Ядро успешно перезапущено",reloadConfigsSuccess:"Конфигурации успешно перезагружены",updateGeoSuccess:"Geo база данных успешно обновлена",chains:"Цепочки",outbound:"Исходящий",sortBy:"Сортировать по",rule:"Правило",sourceIP:"Исходный IP",activeConnections:"Активные",closedConnections:"Закрытые",logLevel:"Уровень журнала",logType:"Тип журнала",twoColumnProxyGroup:"Группа прокси в два столбца",type:"Тип",process:"Процесс",connectTime:"Время",sourcePort:"Исходный порт",destination:"Разрешенный адрес",destinationType:"Тип разрешения",geoip:"GeoIP",geoipCountryDatabaseURL:"URL базы стран GeoIP",geoipASNDatabaseURL:"URL базы ASN GeoIP",geoipDatabaseURLTip:"Используется для локального определения информации GeoIP (страна / ASN) для IP-адресов соединений. Файл mmdb загружается по этому адресу и кэшируется в браузере. Оставьте пустым для значения по умолчанию.",inboundUser:"Входящий пользователь",outboundType:"Тип исходящего",fromOutbound:"Из исходящего",basic:"Основное",traffic:"Трафик",sourceAndDestination:"Источник и назначение",rawData:"Исходные данные",geoInfo:"GeoIP",dl:"Загр",ul:"Отдч",dlSpeed:"Загрузка",ulSpeed:"Отдача",settings:"Настройки",speedtestUrl:"URL теста скорости",speedtestTimeout:"Таймаут теста скорости",speedtestMode:"Режим теста скорости",speedtestModeDashboard:"Управление панелью",speedtestModeCore:"Управление ядром",speedtestModeTip:"Управление панелью оставляет группы Selector, LoadBalance и Smart на тестировании отдельных узлов из панели и показывает прогресс по узлам. Управление ядром вызывает API группового теста ядра, чтобы ядро проверило всю группу сразу.",connectionStyle:"Стиль подключения",card:"Карточка",table:"Таблица",customTableColumns:"Пользовательские столбцы таблицы",customCardLines:"Пользовательские строчки карточки",close:"Закрыть",appearance:"Внешний вид",defaultTheme:"Тема по умолчанию",darkTheme:"Темная тема",proxyProvider:"Провайдер прокси",ruleProvider:"Провайдер правил",expire:"Истекает",noExpire:"Нет",updated:"Обновлено",upgradeDashboard:"Обновить панель до новой версии",reloadConfigs:"Перезагрузить конфигурации",updateConfigs:"Обновить конфигурации",updateConfigsSuccess:"Конфигурации успешно обновлены",configFilePath:"Путь к файлу конфигурации",configFilePathPlaceholder:"Абсолютный путь, например /etc/mihomo/config.yaml",configPayload:"Содержимое конфигурации",configPayloadPlaceholder:"Вставьте YAML содержимое конфигурации здесь...",forceUpdate:"Принудительное обновление",or:"ИЛИ",defaultsort:"По конфигурациям",nameasc:"Имя по возрастанию",namedesc:"Имя по убыванию",latencydesc:"Задержка по убыванию",latencyasc:"Задержка по возрастанию",language:"Язык",automaticDisconnection:"Автоматическое отключение",backend:"Бэкенд",tunMode:"Режим Tun",upgradeCore:"Обновить ядро до новой версии",upgradeToRelease:"Обновить ядро до Release",upgradeToAlpha:"Обновить ядро до Alpha",updateGeoDatabase:"Обновить GEO",truncateProxyName:"Усечение имени прокси",disableProxiesPageTextSelect:"Запретить выделение текста на странице прокси",sourceIPLabels:"Метки исходного IP",proxyPreviewType:"Тип предварительного просмотра прокси",auto:"Авто",dots:"Точки",bar:"Полоса",exportSettings:"Экспорт настроек",importSettings:"Импорт настроек",dashboardSettings:"Настройки панели",dashboardSettingsCore:"Ядро",dashboardSettingsJsonFile:"JSON файл",dashboardSettingsUrl:"URL",autoSyncSettings:"Автосинхронизация настроек",uploadSettings:"Загрузить настройки в ядро",syncSettings:"Синхронизировать настройки из ядра",deleteUploadedSettings:"Удалить загруженные настройки из ядра",connectionSettings:"Настройки подключения",proxySettings:"Настройки прокси",logSettings:"Настройки журнала",ruleSettings:"Настройки правил",connectionDetails:"Детали подключения",customTheme:"Пользовательская тема",unavailableProxy:"Скрыть недоступное",protocolTips:"Вы пытаетесь подключиться к HTTP-бэкенду, но Zashboard предоставляется через HTTPS. Это может вызвать ошибки подключения. Разрешите небезопасный контент в настройках браузера или используйте HTTP-версию панели, например, http://board.zash.run.place.",global:"Глобальный",direct:"Прямой",lowLatencyDesc:"Желтый порог",mediumLatencyDesc:"Красный порог",fonts:"Шрифты",emoji:"Emoji",unauthorizedTip:"Не авторизован, пожалуйста, войдите снова.",restartCore:"Перезапустить ядро",checkCoreUpgrade:"Проверить доступность обновления ядра",autoUpgradeDashboard:"Автоматически обновлять панель до новой версии",autoUpgradeCore:"Автоматически обновлять ядро до новой версии",secondaryPath:"Дополнительный путь",secondaryPathTip:'Если присутствует, начните с "/", в противном случае оставьте пустым.',logRetentionLimit:"Лимит хранения журнала",DNSQuery:"DNS-запрос",currentBackendUnavailable:"Текущий бэкенд недоступен. Попробуйте переключиться на другой бэкенд?",confirm:"Подтвердить",backendSwitchTo:"Бэкенд переключен на {backend}",ipv6Test:"IPv6-тест",socksPort:"Порт Socks",httpPort:"Порт HTTP",mixedPort:"Порт Mixed",redirPort:"Порт Redir",tproxyPort:"Порт TProxy",tableSize:"Размер таблицы",proxyCardSize:"Размер карточки прокси",small:"Маленький",normal:"Нормальный",large:"Большой",autoIPCheckWhenStart:"Автоматическая проверка IP при запуске",autoConnectionCheckWhenStart:"Автоматическая проверка соединений при запуске",networkInfo:"Информация о сети",autoSwitchTheme:"Автоматический темы",customBackgroundURL:"URL фона",splitOverviewPage:"Разделить страницу с обзором",manageHiddenGroup:"Управление скрытыми группами",transparent:"Прозрачность",proxyGroupIconSize:"Размер иконки группы прокси",proxyGroupIconMargin:"Отступ иконки группы прокси",allowLan:"Разрешить локальную сеть",proxyChainDirection:"Направление цепочки прокси",showFullProxyChain:"Показать полную цепочку прокси",reverse:"Обратное",sniffHost:"Захватывать хост",ipScreenshotTip:"Пожалуйста, убедитесь, что реальный IP скрыт при создании скриншотов.",showStatisticsWhenSidebarCollapsed:"Показать статистику при сворачивании панели",totalConnections:"Статистика соединений",totalConnectionsTip:`Учитываются только соединения, открытые во время работы панели. +Время начала записи: {statsStartTime}`,manual:"Ручной",tableWidthMode:"Режим ширины таблицы",testFailed:"Тест задержки таймаут",testFinishedTip:`{name} +{number}/{total} Тест завершен`,testFinishedResultTip:`{name} +Тест завершен: {success} Успешно, {failed} Таймаут`,testFailedTip:`{name} +Тест задержки таймаут`,updateFinishedTip:"{number} Обновление завершено",independentLatencyTest:"Независимый тест задержки",independentLatencyTestTip:"Включение независимого тестирования задержки попытается использовать URL-адреса, указанные в конфигурационном файле, вместо настроек URL-адресов в панели управления во время теста задержки. Задержка будет отображаться отдельно на основе URL-адресов, установленных в группах политик.",search:"Поиск",searchProxyGroup:"Поиск групп прокси",searchProxyNode:"Поиск узлов прокси",proxySearchModeGlobal:"Поиск узлов",proxySearchModeGroup:"Поиск групп политик",importing:"Импортируется",hideConnection:"Скрыть соединение",showConnection:"Показать соединение",hideConnectionRegex:"Скрыть соединение Regex",hideConnectionTip:"Используйте регистронезависимое регулярное выражение, чтобы найти и скрыть нежелательные соединения.",hideLog:"Скрыть журнал",showLog:"Показать журнал",hideLogRegex:"Скрыть журнал Regex",hideLogTip:"Используйте регистронезависимое регулярное выражение, чтобы найти и скрыть нежелательные записи журнала.",sameConnectionLogs:"Журналы одного соединения",loadBalance:"Балансировка нагрузки",label:"Метка",optional:"Необязательно",swipeInTabs:"Провести для переключения вкладок",swipeInPages:"Провести для переключения страниц",simpleCardPreset:"Простой",detailedCardPreset:"Подробный",refresh:"Обновить",reset:"Сбросить",resetSettings:"Сбросить настройки",resetSettingsConfirm:"Вы уверены, что хотите сбросить все настройки панели к значениям по умолчанию? Это действие нельзя отменить.",backgroundToneSwitchConfirm:"Для этого фона лучше подходит {theme}. Переключить тему?",backgroundToneLightThemeLabel:"светлая тема",backgroundToneDarkThemeLabel:"темная тема",minProxyCardWidth:"Минимальная ширина карточки прокси",displayGlobalByMode:"Отображать GLOBAL по режиму",displaySelectedNode:"Отображать выбранный узел",displayLatencyNumber:"Отображать задержку",disconnectOnRuleDisable:"Разрывать соединения при отключении правила",tipForFixed:"Текущая стратегическая группа закреплена за текущим узлом. Нажмите «Тест скорости», чтобы восстановить поведение {type}.",remoteAddress:"удалённый адрес",save:"Сохранить",moreDetails:"Подробнее",moreSettings:"Дополнительные настройки",customIcon:"Пользовательская иконка",dropOrClickUpload:"Перетащите изображение или вставьте URL",disablePullToRefresh:"Отключить свойство обновления",disablePullToRefreshTip:"Компоненты Pull-to-refresh и виртуальной прокрутки иногда могут конфликтовать. Если при прокрутке вверх-вниз у вас часто возникают задержки или случайные срабатывания Pull-to-refresh, попробуйте отключить Pull-to-refresh.",keyboardShortcuts:"Горячие клавиши",keyboardShortcutsTip:"Нажмите на поле и затем нужную клавишу или сочетание клавиш. Для очистки используйте Backspace или Delete.",keyboardShortcutPageName:"Страница {name}",toggleSidebar:"Переключить боковую панель",switchToPreviousBackend:"Переключиться на предыдущий бэкенд",switchToNextBackend:"Переключиться на следующий бэкенд",openBackendSettings:"Открыть настройки бэкенда",keyboardShortcutsConflict:"Обнаружены повторяющиеся горячие клавиши: {keys}. Сработает только первое совпадение.",resetKeyboardShortcuts:"Сбросить горячие клавиши",pressAnyKey:"Нажмите клавишу",displayAllFeatures:"Показать все функции",displayAllFeaturesTip:"Показать все функции, включая те, которые не поддерживаются официальной версией sing-box. Если вы используете форк sing-box, поддерживающий некоторые из этих функций, вы можете попробовать их включить.",blurIntensity:"Интенсивность размытия",scrollAnimationEffect:"Эффект анимации прокрутки",importFromFile:"Импортировать из файла",importFromUrl:"Импортировать из URL",uploadSettingsSuccess:"Настройки успешно загружены",uploadSettingsIconReflectListRemoved:"Данные пользовательских иконок слишком велики и были удалены при загрузке. Уменьшите их размер и попробуйте снова.",syncSettingsSuccess:"Настройки успешно синхронизированы",syncSettingsConfirm:`В бэкенде сохранены настройки, которые перезапишут следующие локальные настройки: + +{keys} + +Применить их?`,importSettingsConfirm:`Импортированные настройки перезапишут следующие локальные настройки: + +{keys} + +Применить их?`,deleteUploadedSettingsSuccess:"Загруженные настройки успешно удалены",deleteUploadedSettingsConfirm:"Вы уверены, что хотите удалить загруженные на бэкенд настройки? Это действие нельзя отменить.",upgradeSuccess:"Обновление до новой версии выполнено успешно",numberOfChartsInSidebar:"Количество графиков в боковой панели",flushSmartWeights:"Очистить Smart веса",IPInfoAPI:"API информации о IP",IPInfoAPITip:"Этот API будет использоваться для проверки IP-адресов при запросах информации о глобальных узлах, определения геолокации IP-адресов в деталях соединения, а также для определения геолокации IP-адресов при DNS-запросах в панели.",general:"Универсальный",groupProxiesByProvider:"Группировать прокси по провайдеру",useSmartGroupSort:"Сортировать Smart группы по частоте использования",all:"Все",autoDisconnectIdleUDP:"Автоматически отключить UDP-идле",autoDisconnectIdleUDPTime:"Время UDP-идле",autoDisconnectIdleUDPTip:"При включении открытие zashboard приведёт к закрытию UDP-соединений, продолжительность которых превышает заданное количество минут. Это может помочь в случае с некоторыми UDP-соединениями, которые не разрываются автоматически, как ожидается.",customGlobalNode:"Пользовательский глобальный узел",connectionTopology:"Топология соединений",editBackend:"Редактировать бэкенд",editBackendTitle:"Редактировать конфигурацию бэкенда",selectBackend:"Выберите бэкенд",backendConnectionFailed:"Не удалось подключиться к бэкенду, проверьте конфигурацию",backendConfigSaved:"Конфигурация бэкенда успешно сохранена",saveFailed:"Не удалось сохранить",checking:"Проверка...",copySuccess:"Копирование успешно",importFromBackendTip:"По умолчанию ./zashboard-settings.json находится в папке ui. Пожалуйста, убедитесь, что папка ui существует и содержит файл конфигурации.",importFailed:"Импорт не выполнен, проверьте url {url}",autoImportFromUrl:"Автоматический импорт",autoImportFromUrlTip:"При включении настройки будут автоматически импортироваться из url при открытии zashboard. Если хэш отличается от последнего импортированного хэша, настройки будут импортированы заново и страница будет обновлена.",getting:"Получение...",mmdbSizeTip:"Если вы используете mmdb-формат файлов geo, то количество будет равно 0",displayFinalOutbound:"Показать конечный исходящий узел",groupTestUrls:"Группа тестовых URL",groupTestUrlsTip:"Для ручных тестов, запущенных из панели, установите тестовые URL > URL в конфигурации > Глобальные тестовые URL, но для групп с UrlTest/Fallback и т.д., URL в конфигурации все равно нужно изменить, поэтому это рекомендуется только для Selector и т.д. ",groupName:"Группа имени",unknown:"Неизвестно",sourceIPAddress:"Исходный IP-адрес",ruleMatch:"Совпадение правила",proxyChainEntry:"Вход в цепочку прокси",proxyChainExit:"Выход из цепочки прокси",nodeType:"Тип узла",connectionCount:"Количество соединений",zashboardSettings:"Настройки панели",backendSettings:"Настройки бэкенда",generalSettings:"Общие настройки",overviewSettings:"Настройки обзора",overviewCardSettings:"Настройки карточек",chartsCard:"Карточка графиков",networkCard:"Сетевая карточка",providerTrafficOverview:"Обзор трафика провайдера",topologyCharts:"Топологические графики",connectionHistory:"История подключений",ruleHitCountCard:"Статистика попаданий/промахов правил",latency:"Задержка",icon:"Иконка",settingsVisibility:"Видимость настроек",settingsMenuGeneral:"Общие",settingsMenuBackend:"Бэкенд",settingsMenuProxies:"Прокси",settingsMenuConnections:"Подключения",settingsMenuOverview:"Обзор",ports:"Порты",actions:"Действия",showAllPreset:"Показать все",minimalPreset:"Минимальный вид",settingsPageTwoColumns:"Двухколоночный режим",moveUp:"Вверх",moveDown:"Вниз",aggregateBy:"Агрегация по",aggregateBySourceIP:"По исходному IP",aggregateByDestination:"По назначению",aggregateByProcess:"По процессу",aggregateByOutbound:"По исходящему",totalTraffic:"Общий трафик",total:"Итого",clearConnectionHistory:"Очистить историю соединений",clearConnectionHistoryConfirm:"Вы уверены, что хотите очистить все данные истории соединений? Это действие нельзя отменить.",clearConnectionHistorySuccess:"История соединений успешно очищена",autoCleanupInterval:"Интервал автоматической очистки",autoCleanupIntervalWeek:"Еженедельно",autoCleanupIntervalMonth:"Ежемесячно",autoCleanupIntervalQuarter:"Ежеквартально",autoCleanupIntervalNever:"Никогда",remainingTraffic:"Осталось",ruleHitCount:"Попадание: {count} раз",ruleLastHit:"Последнее попадание: {time}",ruleMissCount:"Промах: {count} раз",ruleLastMiss:"Последний промах: {time}",RarelyUsed:"Редко используется",OccasionalUsed:"Иногда используется",MostUsed:"Часто используется",proxyFolderMode:"Режим папок",folderModeAuto:"Авто",folderModeOn:"Вкл",folderModeOff:"Выкл",folder_all:"Все",folder_uncategorized:"Без категории",folder_manage:"Управление папками",folder_builtin_strategy:"Группы стратегий",folder_builtin_nodes:"Группы узлов",folder_name:"Имя папки",folder_new_placeholder:"Имя новой папки",folder_rules:"Авто-правила",folder_rule_auto:"Авто",folder_rule_regex:"Regex",folder_rule_exclude_regex:"Exclude regex",folder_auto_hasGroup:"Содержит под-группы",folder_auto_nodeOnly:"Только узлы",folder_add_rule:"Добавить правило",folder_manual_includes:"Включено вручную",folder_filter_placeholder:"Поиск групп",folder_preview:"Автоматически подобранные группы",folder_no_matches:"Нет подходящих групп",folder_delete_confirm:"Удалить папку «{name}»?"},w0e={setup:"配置",overview:"概览",proxies:"代理",rules:"规则",connections:"连接",logs:"日志",tools:"工具",tailscale:"Tailscale",terminal:"终端",default:"默认",backendType:"后端类型",clashApi:"Clash API",singboxApi:"sing-box API",singboxConnectionFailed:"无法连接 sing-box 原生 API",skip:"跳过",networkQuality:"网络质量",stunTest:"STUN 测试",startTest:"开始测试",cancelTest:"取消测试",serverField:"服务器",externalAddress:"外部地址",natMapping:"NAT 映射",natFiltering:"NAT 过滤",natTypeDetection:"NAT 类型检测",idleLatency:"空闲延迟",downloadRPM:"下载 RPM",uploadRPM:"上传 RPM",elapsed:"已用时",results:"结果",http3:"HTTP/3",maxRuntime:"最长运行时间",startTime:"启动时间",notSupportedByServer:"服务器不支持",configURL:"配置 URL",serial:"串行测试",accuracyHigh:"高",accuracyMedium:"中",accuracyLow:"低",fetchingConfiguration:"正在获取配置...",binding:"正在绑定...",exitNode:"出口节点",ping:"Ping",logout:"登出",online:"在线",offline:"离线",peers:"节点",noEndpoints:"没有 Tailscale 端点",backendState:"状态",statusLabel:"状态",thisDevice:"本设备",networkLabel:"网络",expired:"已过期",connectViaSSH:"通过 SSH 连接",disabledLabel:"已禁用",directConnection:"直连",derpRelayed:"DERP 中继连接",sharedIn:"共享接入",addresses:"地址",hostnameLabel:"主机名",osLabel:"操作系统",keyExpiry:"密钥到期",lastSeen:"最后在线",detailsLabel:"详情",authURL:"认证 URL",showAuthQR:"显示认证 URL 二维码",derpRegion:"DERP 区域",endpointLabel:"端点",activeLabel:"已启用",availableLabel:"可用",dragOrClickToAdd:"拖拽或点击添加",addRow:"添加行",sshConfiguration:"SSH 配置",terminalType:"终端类型",rememberSSHOptions:"记住 SSH 配置",editSSHConfiguration:"编辑 SSH 配置",connected:"已连接",notConnected:"未连接",copy:"复制",yes:"是",peer:"节点",username:"用户名",connect:"连接",sessionClosed:"会话已关闭",newSession:"新建会话",paste:"粘贴",terminalKeys:"终端按键",peerNotFound:"未找到节点",connecting:"连接中...",disconnect:"断开连接",sessionExited:"会话退出,退出码 {code}",signalSuffix:"(信号 {signal})",streamEnded:"流结束,状态码 {code}",terminalSettings:"终端设置",terminalThemeLight:"主题(浅色)",terminalThemeDark:"主题(深色)",fontFamily:"字体",fontSize:"字体大小",defaultFont:"默认",usbip:"USB/IP",usbipNoServer:"未找到 usbip-server",usbipServerTagged:"USB/IP:{tag}",usbipDevices:"设备",usbipConnectDevice:"连接设备",usbipAuthorizedDevices:"已授权设备",usbipOtherDevice:"其他设备…",usbipDetach:"断开",usbipPickDeviceHint:"选择一个 USB 设备,通过此 usbip-server 共享。",usbipNoDevicesShared:"尚未共享任何设备。",usbipInsecureContext:"WebUSB 需要安全上下文,请通过 localhost 或 HTTPS 打开仪表盘。",usbipUnsupportedBrowser:"要共享设备,请使用基于 Chromium 的浏览器访问仪表盘,或在 macOS / Android 上使用 sing-box 图形客户端。",usbipClaimBlockedClass:"无法共享“{label}”:浏览器禁止共享该设备的接口类别(如 HID、存储、音频或视频)。",usbipClaimBlockedBusy:"无法共享“{label}”:其他程序或驱动正在占用它。请先关闭占用它的程序,然后重试。",usbipStateAttaching:"连接中...",usbipStateReady:"就绪",usbipStateError:"错误",usbipStateIdle:"空闲",usbipStateAttached:"已挂载",usbipStateUnavailable:"不可用",usbipIdentity:"标识",usbipProduct:"产品",usbipSerialNumber:"序列号",usbipVersion:"版本",usbipConnection:"连接",usbipBusId:"总线 ID",usbipBackend:"后端",usbipSpeed:"速率",usbipBusDevice:"总线 / 设备",usbipClassInterfaces:"类别与接口",usbipDeviceClass:"设备类别",usbipDefinedAtInterface:"在接口层定义",usbipConfigurations:"配置数",usbipInterfaceN:"接口 {n}",protocol:"协议",host:"主机",port:"端口",password:"密码",submit:"提交",cancel:"取消",delete:"删除",download:"下载",upload:"上传",downloadSpeed:"下载速度",uploadSpeed:"上传速度",memoryUsage:"内存使用",goroutines:"Goroutines",noData:"暂无数据",flushFakeIP:"清空Fake IP",flushDNSCache:"清空DNS缓存",flushDNSCacheSuccess:"DNS缓存清空成功",flushFakeIPSuccess:"Fake IP清空成功",flushSmartWeightsSuccess:"Smart权重清空成功",restartCoreSuccess:"核心重启成功",reloadConfigsSuccess:"配置重载成功",updateGeoSuccess:"GEO数据库更新成功",chains:"代理链",outbound:"出站节点",sortBy:"排序方式",rule:"规则",sourceIP:"源IP",activeConnections:"活跃",closedConnections:"已关闭",logLevel:"日志等级",logType:"日志类型",twoColumnProxyGroup:"双列显示代理组",type:"类型",process:"进程",connectTime:"连接时间",sourcePort:"源端口",destination:"解析地址",destinationType:"解析类型",geoip:"归属信息",geoipCountryDatabaseURL:"GeoIP 国家库地址",geoipASNDatabaseURL:"GeoIP ASN 库地址",geoipDatabaseURLTip:"用于本地解析连接 IP 的归属信息(国家 / ASN),从该地址加载 mmdb 并缓存在浏览器中。留空则使用默认地址。",inboundUser:"入站用户",outboundType:"出站类型",fromOutbound:"来源出站",basic:"基本",traffic:"流量",sourceAndDestination:"来源与目的",rawData:"原始数据",geoInfo:"归属信息",dl:"下载",ul:"上传",dlSpeed:"下载速度",ulSpeed:"上传速度",settings:"设置",speedtestUrl:"测速地址",speedtestTimeout:"测速超时",speedtestMode:"测速方式",speedtestModeDashboard:"面板控制",speedtestModeCore:"核心控制",speedtestModeTip:"面板控制会让 Selector、LoadBalance、Smart 组沿用面板逐个测试节点的逻辑,并展示每个节点的测试进度。核心控制会调用核心的组测速接口,由核心一次性完成整组测速。",connectionStyle:"连接样式",card:"卡片",table:"表格",customTableColumns:"自定义表格列",customCardLines:"自定义卡片行",close:"关闭",appearance:"外观",defaultTheme:"默认主题",darkTheme:"深色主题",proxyProvider:"代理提供商",ruleProvider:"规则提供商",expire:"到期时间",noExpire:"不限时",updated:"更新于",upgradeDashboard:"升级面板",reloadConfigs:"重载配置",updateConfigs:"更新配置",updateConfigsSuccess:"配置更新成功",configFilePath:"配置文件路径",configFilePathPlaceholder:"绝对路径,例如 /etc/mihomo/config.yaml",configPayload:"配置内容",configPayloadPlaceholder:"在此粘贴 YAML 配置内容...",forceUpdate:"强制更新",or:"或",defaultsort:"按配置排序",nameasc:"按名称升序",namedesc:"按名称降序",latencydesc:"按延迟降序",latencyasc:"按延迟升序",language:"面板语言",automaticDisconnection:"切换节点时自动断开连接",backend:"后端",upgradeCore:"升级核心",upgradeToRelease:"升级到 Release",upgradeToAlpha:"升级到 Alpha",updateGeoDatabase:"更新GEO",tunMode:"Tun 模式",truncateProxyName:"截断节点名称",disableProxiesPageTextSelect:"禁用代理页文字选中",sourceIPLabels:"源IP标签",proxyPreviewType:"节点预览类型",auto:"自动",dots:"点",bar:"条",exportSettings:"导出设置",importSettings:"导入设置",dashboardSettings:"面板配置",dashboardSettingsCore:"核心",dashboardSettingsJsonFile:"JSON 文件",dashboardSettingsUrl:"URL",autoSyncSettings:"自动同步设置",uploadSettings:"上传设置到核心",syncSettings:"从核心同步设置",deleteUploadedSettings:"从核心删除已上传设置",connectionSettings:"连接设置",proxySettings:"代理设置",logSettings:"日志设置",ruleSettings:"规则设置",connectionDetails:"连接详情",customTheme:"自定义主题",unavailableProxy:"隐藏不可用节点",protocolTips:"您正在尝试连接一个http后端但zashboard是通过https提供的,这可能会导致连接错误,请在浏览器设置中允许不安全的内容,或者使用http版本面板例如http://board.zash.run.place",global:"全局",direct:"直连",lowLatencyDesc:"黄色的阈值",mediumLatencyDesc:"红色的阈值",fonts:"面板字体",emoji:"Emoji",unauthorizedTip:"未授权,请重新登录",restartCore:"重启核心",checkCoreUpgrade:"检查核心升级",autoUpgradeDashboard:"自动升级面板",autoUpgradeCore:"自动升级核心",secondaryPath:"二级路径",secondaryPathTip:"如果有的话以/开头,没有则留空不填",logRetentionLimit:"日志保留条数",DNSQuery:"DNS 查询",currentBackendUnavailable:"当前后端不可用,尝试切换到其他后端?",confirm:"确定",backendSwitchTo:"已切换后端为{backend}",ipv6Test:"IPv6 测试",socksPort:"Socks 端口",httpPort:"HTTP 端口",mixedPort:"Mixed 端口",redirPort:"Redir 端口",tproxyPort:"TProxy 端口",tableSize:"表格尺寸",proxyCardSize:"节点卡片尺寸",small:"小",normal:"正常",large:"大",autoIPCheckWhenStart:"自动检查 IP",autoConnectionCheckWhenStart:"自动检查连接",networkInfo:"网络信息",autoSwitchTheme:"自动切换主题",customBackgroundURL:"面板背景",splitOverviewPage:"分离概览页",manageHiddenGroup:"管理隐藏代理组",transparent:"透明度",proxyGroupIconSize:"策略组图标尺寸",proxyGroupIconMargin:"策略组图标间距",allowLan:"允许局域网",proxyChainDirection:"代理链方向",showFullProxyChain:"完整显示代理链",reverse:"反向",sniffHost:"嗅探主机",ipScreenshotTip:"截图时请确保隐藏IP",showStatisticsWhenSidebarCollapsed:"侧边栏折叠时显示统计",totalConnections:"连接统计",totalConnectionsTip:`只能统计面板打开期间的连接。 +记录开始时间:{statsStartTime}`,manual:"手动",tableWidthMode:"表格宽度模式",testFailed:"测速超时",testFinishedTip:`{name} +{number}/{total} 测试完成`,testFinishedResultTip:`{name} +测试完成: {success} 成功,{failed} 超时`,testFailedTip:`{name} +测速超时`,updateFinishedTip:"{number} 更新完成",independentLatencyTest:"独立延迟测试",independentLatencyTestTip:"开启独立延迟测试会在测速中尽可能的使用配置文件中的url覆盖面板设置的url,并展示根据策略组设置的url获取的延迟。",search:"搜索",searchProxyGroup:"搜索代理组",searchProxyNode:"搜索节点",proxySearchModeGlobal:"节点搜索",proxySearchModeGroup:"策略组搜索",importing:"正在导入",hideConnection:"隐藏连接",showConnection:"显示连接",hideConnectionRegex:"隐藏连接正则",hideConnectionTip:"可通过不区分大小写的正则表达式来匹配并隐藏不需要看到的连接",hideLog:"隐藏日志",showLog:"显示日志",hideLogRegex:"隐藏日志正则",hideLogTip:"可通过不区分大小写的正则表达式来匹配并隐藏不需要看到的日志",sameConnectionLogs:"同连接日志",loadBalance:"负载均衡",label:"标签",optional:"可选",swipeInTabs:"滑动切换页面二级标签",swipeInPages:"滑动切换页面",simpleCardPreset:"简洁预设",detailedCardPreset:"详细预设",refresh:"刷新",reset:"重置",resetSettings:"恢复默认设置",resetSettingsConfirm:"确定要将面板设置恢复为默认值吗?此操作不可撤销。",backgroundToneSwitchConfirm:"检测到这张背景图更适合使用{theme},是否切换?",backgroundToneLightThemeLabel:"浅色主题",backgroundToneDarkThemeLabel:"深色主题",minProxyCardWidth:"节点卡片最小宽度",displayGlobalByMode:"根据模式显示 GLOBAL",displaySelectedNode:"显示选中节点",displayLatencyNumber:"显示延迟数字",disconnectOnRuleDisable:"禁用规则时打断连接",tipForFixed:"当前策略组被固定在了当前节点,点击测速来恢复{type}行为",remoteAddress:"远端地址",save:"保存",moreDetails:"更多详情",moreSettings:"更多设置",customIcon:"自定义图标",dropOrClickUpload:"拖拽图片或输入 URL",disablePullToRefresh:"禁用下拉刷新",disablePullToRefreshTip:"下拉刷新和虚拟滚动的组件有时会有冲突,如果你在上下滚动的时候经常卡顿或者误触发下拉刷新,可以尝试禁用下拉刷新",keyboardShortcuts:"快捷键设置",keyboardShortcutsTip:"点击输入框后可直接按单键或组合键设置快捷键,按 Backspace 或 Delete 可清空。",keyboardShortcutPageName:"{name}页",toggleSidebar:"展开/收起侧边栏",switchToPreviousBackend:"切换到上一个后端",switchToNextBackend:"切换到下一个后端",openBackendSettings:"打开后端设置",keyboardShortcutsConflict:"检测到重复快捷键:{keys}。只有第一项会生效。",resetKeyboardShortcuts:"重置快捷键",pressAnyKey:"按下任意键",displayAllFeatures:"显示所有功能",displayAllFeaturesTip:"显示所有功能,包括sing-box官方版本不支持的功能,如果您使用了fork版本的sing-box支持其中的某些功能,可以尝试启用",blurIntensity:"毛玻璃强度",scrollAnimationEffect:"滚动动画效果",importFromFile:"从文件导入",importFromUrl:"从 URL 导入",uploadSettingsSuccess:"设置上传成功",uploadSettingsIconReflectListRemoved:"自定义图标数据过长,上传时已自动移除这部分内容,请精简后重试。",syncSettingsSuccess:"设置同步成功",syncSettingsConfirm:`后端存储的设置将覆盖以下本地设置: + +{keys} + +是否应用?`,importSettingsConfirm:`导入的设置将覆盖以下本地设置: + +{keys} + +是否应用?`,deleteUploadedSettingsSuccess:"已上传设置删除成功",deleteUploadedSettingsConfirm:"确定要删除后端上已上传的设置吗?此操作不可撤销。",upgradeSuccess:"升级成功",numberOfChartsInSidebar:"侧边栏图表数量",flushSmartWeights:"清空Smart权重",IPInfoAPI:"IP信息API",IPInfoAPITip:"此API会用于IP检查中全球节点IP信息查询、连接详情中的IP地理信息查询、面板DNS查询中的IP地理信息查询。",general:"通用",groupProxiesByProvider:"节点根据提供商分组",useSmartGroupSort:"Smart组根据使用频率排序",all:"全部",autoDisconnectIdleUDP:"自动断开空闲UDP",autoDisconnectIdleUDPTime:"UDP空闲时间",autoDisconnectIdleUDPTip:"启用后,打开zashboard时将关闭持续时间超过配置分钟数的UDP连接,这可能对某些无法正常自动断开的UDP连接带来帮助。(这是作者自己的私货,你大概率不需要打开它)",customGlobalNode:"自定义全局节点",connectionTopology:"连接拓扑",editBackend:"编辑后端",editBackendTitle:"修改后端配置",selectBackend:"选择后端",backendConnectionFailed:"后端连接失败,请检查配置信息",backendConfigSaved:"后端配置保存成功",saveFailed:"保存失败",checking:"检查中...",copySuccess:"复制成功",importFromBackendTip:"默认的./zashboard-settings.json位于ui文件夹下,导入前请确保ui文件夹下存在配置文件。",importFailed:"导入失败,请检查url {url}",autoImportFromUrl:"自动导入",autoImportFromUrlTip:"启用后,每次打开zashboard时会自动从url设置导入并计算hash,如果hash与上次导入的hash不同,则重新导入并刷新页面。",getting:"获取中...",mmdbSizeTip:"mmdb等格式的geo文件无法统计数量,因此数量为0",displayFinalOutbound:"显示最终出口节点",groupTestUrls:"组测试链接",groupTestUrlsTip:"对于从面板手动触发的测试,此处设置测试链接 > 配置中的链接 > 面板全局测试链接,但是对于UrlTest/Fallback等具有核心内部的定时测速逻辑的组,仍然需要修改配置中的链接,此处仅推荐Selector等场景",groupName:"组名",unknown:"未知",sourceIPAddress:"源IP地址",ruleMatch:"规则匹配",proxyChainEntry:"代理链入口",proxyChainExit:"代理链出口",nodeType:"节点类型",connectionCount:"连接数",zashboardSettings:"面板设置",backendSettings:"后端设置",generalSettings:"常规设置",overviewSettings:"概览设置",overviewCardSettings:"卡片设置",chartsCard:"图表卡片",networkCard:"网络卡片",providerTrafficOverview:"提供商流量概览",topologyCharts:"拓扑图表",connectionHistory:"连接历史",ruleHitCountCard:"规则命中统计",latency:"延迟",icon:"图标",settingsVisibility:"设置项显示控制",settingsMenuGeneral:"面板",settingsMenuBackend:"后端",settingsMenuProxies:"代理",settingsMenuConnections:"连接",settingsMenuOverview:"概览",ports:"端口",actions:"操作",showAllPreset:"全部显示",minimalPreset:"精简显示",settingsPageTwoColumns:"双列布局",moveUp:"上移",moveDown:"下移",aggregateBy:"聚合方式",aggregateBySourceIP:"按源IP",aggregateByDestination:"按目标地址",aggregateByProcess:"按进程",aggregateByOutbound:"按出站节点",totalTraffic:"总流量",total:"总计",clearConnectionHistory:"清空连接历史",clearConnectionHistoryConfirm:"确定要清空所有连接历史数据吗?此操作不可恢复。",clearConnectionHistorySuccess:"连接历史数据清空成功",autoCleanupInterval:"自动清理间隔",autoCleanupIntervalWeek:"每周",autoCleanupIntervalMonth:"每月",autoCleanupIntervalQuarter:"每季度",autoCleanupIntervalNever:"永不",remainingTraffic:"剩余流量",ruleHitCount:"命中: {count} 次",ruleLastHit:"最后命中: {time}",ruleMissCount:"未命中: {count} 次",ruleLastMiss:"最后未命中: {time}",RarelyUsed:"很少使用",OccasionalUsed:"偶尔使用",MostUsed:"经常使用",proxyFolderMode:"文件夹模式",folderModeAuto:"自动",folderModeOn:"开启",folderModeOff:"关闭",folder_all:"全部",folder_uncategorized:"未分类",folder_manage:"管理文件夹",folder_builtin_strategy:"策略组",folder_builtin_nodes:"节点组",folder_name:"文件夹名称",folder_new_placeholder:"新文件夹名称",folder_rules:"自动规则",folder_rule_auto:"自动",folder_rule_regex:"正则",folder_rule_exclude_regex:"排除正则",folder_auto_hasGroup:"包含子组",folder_auto_nodeOnly:"仅含节点",folder_add_rule:"添加规则",folder_manual_includes:"手动加入",folder_filter_placeholder:"搜索代理组",folder_preview:"自动匹配的代理组",folder_no_matches:"没有匹配的代理组",folder_delete_confirm:"确认删除文件夹「{name}」?"},x0e={setup:"配置",overview:"概覽",proxies:"代理",rules:"規則",connections:"連接",logs:"日誌",tools:"工具",tailscale:"Tailscale",terminal:"終端",default:"預設",backendType:"後端類型",clashApi:"Clash API",singboxApi:"sing-box API",singboxConnectionFailed:"無法連線 sing-box 原生 API",skip:"跳過",networkQuality:"網路品質",stunTest:"STUN 測試",startTest:"開始測試",cancelTest:"取消測試",serverField:"伺服器",externalAddress:"外部位址",natMapping:"NAT 映射",natFiltering:"NAT 過濾",natTypeDetection:"NAT 類型偵測",idleLatency:"閒置延遲",downloadRPM:"下載 RPM",uploadRPM:"上傳 RPM",elapsed:"已用時",results:"結果",http3:"HTTP/3",maxRuntime:"最長執行時間",startTime:"啟動時間",notSupportedByServer:"伺服器不支援",configURL:"設定 URL",serial:"串列測試",accuracyHigh:"高",accuracyMedium:"中",accuracyLow:"低",fetchingConfiguration:"正在取得設定...",binding:"正在繫結...",exitNode:"出口節點",ping:"Ping",logout:"登出",online:"線上",offline:"離線",peers:"節點",noEndpoints:"沒有 Tailscale 端點",backendState:"狀態",statusLabel:"狀態",thisDevice:"本裝置",networkLabel:"網路",expired:"已過期",connectViaSSH:"透過 SSH 連線",disabledLabel:"已停用",directConnection:"直連",derpRelayed:"DERP 中繼連線",sharedIn:"共享接入",addresses:"位址",hostnameLabel:"主機名稱",osLabel:"作業系統",keyExpiry:"金鑰到期",lastSeen:"最後上線",detailsLabel:"詳細資訊",authURL:"驗證 URL",showAuthQR:"顯示驗證 URL 二維碼",derpRegion:"DERP 區域",endpointLabel:"端點",activeLabel:"已啟用",availableLabel:"可用",dragOrClickToAdd:"拖曳或點擊新增",addRow:"新增行",sshConfiguration:"SSH 設定",terminalType:"終端類型",rememberSSHOptions:"記住 SSH 設定",editSSHConfiguration:"編輯 SSH 設定",connected:"已連線",notConnected:"未連線",copy:"複製",yes:"是",peer:"節點",username:"使用者名稱",connect:"連線",sessionClosed:"工作階段已關閉",newSession:"新增工作階段",paste:"貼上",terminalKeys:"終端按鍵",peerNotFound:"找不到節點",connecting:"連線中...",disconnect:"中斷連線",sessionExited:"工作階段結束,結束碼 {code}",signalSuffix:"(訊號 {signal})",streamEnded:"串流結束,狀態碼 {code}",terminalSettings:"終端設定",terminalThemeLight:"主題(淺色)",terminalThemeDark:"主題(深色)",fontFamily:"字型",fontSize:"字型大小",defaultFont:"預設",usbip:"USB/IP",usbipNoServer:"未找到 usbip-server",usbipServerTagged:"USB/IP:{tag}",usbipDevices:"裝置",usbipConnectDevice:"連接裝置",usbipAuthorizedDevices:"已授權裝置",usbipOtherDevice:"其他裝置…",usbipDetach:"中斷",usbipPickDeviceHint:"選擇一個 USB 裝置,透過此 usbip-server 分享。",usbipNoDevicesShared:"尚未分享任何裝置。",usbipInsecureContext:"WebUSB 需要安全內容,請透過 localhost 或 HTTPS 開啟儀表板。",usbipUnsupportedBrowser:"要提供裝置,請使用基於 Chromium 的瀏覽器存取儀表板,或在 macOS / Android 上使用 sing-box 圖形用戶端。",usbipClaimBlockedClass:"無法分享「{label}」:瀏覽器禁止分享此裝置的介面類別(如 HID、儲存、音訊或視訊)。",usbipClaimBlockedBusy:"無法分享「{label}」:其他程式或驅動正在使用它。請先關閉占用它的程式,然後重試。",usbipStateAttaching:"連接中...",usbipStateReady:"就緒",usbipStateError:"錯誤",usbipStateIdle:"閒置",usbipStateAttached:"已掛載",usbipStateUnavailable:"不可用",usbipIdentity:"識別資訊",usbipProduct:"產品",usbipSerialNumber:"序號",usbipVersion:"版本",usbipConnection:"連接",usbipBusId:"匯流排 ID",usbipBackend:"後端",usbipSpeed:"速率",usbipBusDevice:"匯流排 / 裝置",usbipClassInterfaces:"類別與介面",usbipDeviceClass:"裝置類別",usbipDefinedAtInterface:"在介面層定義",usbipConfigurations:"組態數",usbipInterfaceN:"介面 {n}",protocol:"協議",host:"主機",port:"端口",password:"密碼",submit:"提交",cancel:"取消",delete:"刪除",download:"下載",upload:"上傳",downloadSpeed:"下載速度",uploadSpeed:"上傳速度",memoryUsage:"記憶體使用",goroutines:"Goroutines",noData:"暫無資料",flushFakeIP:"清空Fake IP",flushDNSCache:"清空DNS快取",flushDNSCacheSuccess:"DNS快取清空成功",flushFakeIPSuccess:"Fake IP清空成功",flushSmartWeightsSuccess:"Smart權重清空成功",restartCoreSuccess:"核心重啟成功",reloadConfigsSuccess:"配置重載成功",updateGeoSuccess:"GEO資料庫更新成功",chains:"代理鏈",outbound:"出站節點",sortBy:"排序方式",rule:"規則",sourceIP:"源IP",activeConnections:"活躍",closedConnections:"已關閉",logLevel:"日誌等級",logType:"日誌類型",twoColumnProxyGroup:"雙列顯示代理組",type:"類型",process:"進程",connectTime:"連接時間",sourcePort:"源端口",destination:"解析地址",destinationType:"解析類型",geoip:"歸屬資訊",geoipCountryDatabaseURL:"GeoIP 國家庫地址",geoipASNDatabaseURL:"GeoIP ASN 庫地址",geoipDatabaseURLTip:"用於本地解析連線 IP 的歸屬資訊(國家 / ASN),從該地址載入 mmdb 並快取在瀏覽器中。留空則使用預設地址。",inboundUser:"入站用戶",outboundType:"出站類型",fromOutbound:"來源出站",basic:"基本",traffic:"流量",sourceAndDestination:"來源與目的",rawData:"原始資料",geoInfo:"歸屬資訊",dl:"下載",ul:"上傳",dlSpeed:"下載速度",ulSpeed:"上傳速度",settings:"設定",speedtestUrl:"測速地址",speedtestTimeout:"測速超時",speedtestMode:"測速方式",speedtestModeDashboard:"面板控制",speedtestModeCore:"核心控制",speedtestModeTip:"面板控制會讓 Selector、LoadBalance、Smart 組沿用面板逐個測試節點的邏輯,並顯示每個節點的測試進度。核心控制會呼叫核心的組測速介面,由核心一次完成整組測速。",connectionStyle:"連接樣式",card:"卡片",table:"表格",customTableColumns:"自訂表格列",customCardLines:"自訂卡片行",close:"關閉",appearance:"外觀",defaultTheme:"預設主題",darkTheme:"深色主題",proxyProvider:"代理提供商",ruleProvider:"規則提供商",expire:"到期時間",noExpire:"不限時",updated:"更新於",upgradeDashboard:"升級面板",reloadConfigs:"重載配置",updateConfigs:"更新配置",updateConfigsSuccess:"配置更新成功",configFilePath:"配置檔案路徑",configFilePathPlaceholder:"絕對路徑,例如 /etc/mihomo/config.yaml",configPayload:"配置內容",configPayloadPlaceholder:"在此貼上 YAML 配置內容...",forceUpdate:"強制更新",or:"或",defaultsort:"按配置排序",nameasc:"按名稱升序",namedesc:"按名稱降序",latencydesc:"按延遲降序",latencyasc:"按延遲升序",language:"面板語言",automaticDisconnection:"切換節點時自動斷開連接",backend:"後端",upgradeCore:"升級核心",upgradeToRelease:"升級到 Release",upgradeToAlpha:"升級到 Alpha",updateGeoDatabase:"更新GEO",tunMode:"Tun 模式",truncateProxyName:"截斷節點名稱",disableProxiesPageTextSelect:"禁用代理頁文字選取",sourceIPLabels:"源IP標籤",proxyPreviewType:"節點預覽類型",auto:"自動",dots:"點",bar:"條",exportSettings:"匯出設定",importSettings:"匯入設定",dashboardSettings:"面板設定",dashboardSettingsCore:"核心",dashboardSettingsJsonFile:"JSON 檔案",dashboardSettingsUrl:"URL",autoSyncSettings:"自動同步設定",uploadSettings:"上傳設定到核心",syncSettings:"從核心同步設定",deleteUploadedSettings:"從核心刪除已上傳設定",connectionSettings:"連接設定",proxySettings:"代理設定",logSettings:"日誌設定",ruleSettings:"規則設定",connectionDetails:"連接詳情",customTheme:"自訂主題",unavailableProxy:"隱藏不可用節點",protocolTips:"您正在嘗試連接一個http後端但zashboard是通過https提供的,這可能會導致連接錯誤,請在瀏覽器設定中允許不安全的內容,或者使用http版本面板例如http://board.zash.run.place",global:"全域",direct:"直連",lowLatencyDesc:"黃色的閾值",mediumLatencyDesc:"紅色的閾值",fonts:"面板字體",emoji:"Emoji",unauthorizedTip:"未授權,請重新登入",restartCore:"重啟核心",checkCoreUpgrade:"檢查核心升級",autoUpgradeDashboard:"自動升級面板",autoUpgradeCore:"自動升級核心",secondaryPath:"二級路徑",secondaryPathTip:"如果有的話以/開頭,沒有則留空不填",logRetentionLimit:"日誌保留條數",DNSQuery:"DNS 查詢",currentBackendUnavailable:"當前後端不可用,嘗試切換到其他後端?",confirm:"確定",backendSwitchTo:"已切換後端為{backend}",ipv6Test:"IPv6 測試",socksPort:"Socks 端口",httpPort:"HTTP 端口",mixedPort:"Mixed 端口",redirPort:"Redir 端口",tproxyPort:"TProxy 端口",tableSize:"表格尺寸",proxyCardSize:"節點卡片尺寸",small:"小",normal:"正常",large:"大",autoIPCheckWhenStart:"自動檢查 IP",autoConnectionCheckWhenStart:"自動檢查連接",networkInfo:"網路資訊",autoSwitchTheme:"自動切換主題",customBackgroundURL:"面板背景",splitOverviewPage:"分離概覽頁",manageHiddenGroup:"管理隱藏代理組",transparent:"透明度",proxyGroupIconSize:"策略組圖示尺寸",proxyGroupIconMargin:"策略組圖示間距",allowLan:"允許區域網路",proxyChainDirection:"代理鏈方向",showFullProxyChain:"完整顯示代理鏈",reverse:"反向",sniffHost:"嗅探主機",ipScreenshotTip:"截圖時請確保隱藏IP",showStatisticsWhenSidebarCollapsed:"側邊欄摺疊時顯示統計",totalConnections:"連接統計",totalConnectionsTip:`只能統計面板開啟期間的連接。 +記錄開始時間:{statsStartTime}`,manual:"手動",tableWidthMode:"表格寬度模式",testFailed:"測速超時",testFinishedTip:`{name} +{number}/{total} 測試完成`,testFinishedResultTip:`{name} +測試完成: {success} 成功,{failed} 超時`,testFailedTip:`{name} +測速超時`,updateFinishedTip:"{number} 更新完成",independentLatencyTest:"獨立延遲測試",independentLatencyTestTip:"開啟獨立延遲測試會在測速中盡可能的使用配置檔案中的url覆蓋面板設定的url,並展示根據策略組設定的url獲取的延遲。",search:"搜尋",searchProxyGroup:"搜尋代理組",searchProxyNode:"搜尋節點",proxySearchModeGlobal:"節點搜尋",proxySearchModeGroup:"策略組搜尋",importing:"正在匯入",hideConnection:"隱藏連接",showConnection:"顯示連接",hideConnectionRegex:"隱藏連接正則",hideConnectionTip:"可通過不區分大小寫的正則表達式來匹配並隱藏不需要看到的連接",hideLog:"隱藏日誌",showLog:"顯示日誌",hideLogRegex:"隱藏日誌正則",hideLogTip:"可通過不區分大小寫的正則表達式來匹配並隱藏不需要看到的日誌",sameConnectionLogs:"同連線日誌",loadBalance:"負載均衡",label:"標籤",optional:"可選",swipeInTabs:"滑動切換頁面二級標籤",swipeInPages:"滑動切換頁面",simpleCardPreset:"簡潔預設",detailedCardPreset:"詳細預設",refresh:"重新整理",reset:"重設",resetSettings:"恢復預設設定",resetSettingsConfirm:"確定要將面板設定恢復為預設值嗎?此操作無法復原。",backgroundToneSwitchConfirm:"檢測到這張背景圖更適合使用{theme},是否切換?",backgroundToneLightThemeLabel:"淺色主題",backgroundToneDarkThemeLabel:"深色主題",minProxyCardWidth:"節點卡片最小寬度",displayGlobalByMode:"根據模式顯示 GLOBAL",displaySelectedNode:"顯示選中節點",displayLatencyNumber:"顯示延遲數字",disconnectOnRuleDisable:"禁用規則時打斷連接",tipForFixed:"當前策略組被固定在了當前節點,點擊測速來恢復{type}行為",remoteAddress:"遠端地址",save:"儲存",moreDetails:"更多詳情",moreSettings:"更多設定",customIcon:"自訂圖示",dropOrClickUpload:"拖曳圖片或輸入 URL",disablePullToRefresh:"禁用下拉重新整理",disablePullToRefreshTip:"下拉重新整理和虛擬滾動的組件有時會有衝突,如果你在上下滾動的時候經常卡頓或者誤觸發下拉重新整理,可以嘗試禁用下拉重新整理",keyboardShortcuts:"快捷鍵設定",keyboardShortcutsTip:"點擊輸入框後可直接按單鍵或組合鍵設定快捷鍵,按 Backspace 或 Delete 可清空。",keyboardShortcutPageName:"{name}頁",toggleSidebar:"展開/收起側邊欄",switchToPreviousBackend:"切換到上一個後端",switchToNextBackend:"切換到下一個後端",openBackendSettings:"開啟後端設定",keyboardShortcutsConflict:"偵測到重複快捷鍵:{keys}。只有第一項會生效。",resetKeyboardShortcuts:"重設快捷鍵",pressAnyKey:"按下任意鍵",displayAllFeatures:"顯示所有功能",displayAllFeaturesTip:"顯示所有功能,包括sing-box官方版本不支援的功能,如果您使用了fork版本的sing-box支援其中的某些功能,可以嘗試啟用",blurIntensity:"毛玻璃強度",scrollAnimationEffect:"滾動動畫效果",importFromFile:"從檔案匯入",importFromUrl:"從 URL 匯入",uploadSettingsSuccess:"設定上傳成功",uploadSettingsIconReflectListRemoved:"自訂圖示資料過長,上傳時已自動移除這部分內容,請精簡後再試。",syncSettingsSuccess:"設定同步成功",syncSettingsConfirm:`後端儲存的設定將覆蓋以下本地設定: + +{keys} + +是否套用?`,importSettingsConfirm:`匯入的設定將覆蓋以下本地設定: + +{keys} + +是否套用?`,deleteUploadedSettingsSuccess:"已上傳設定刪除成功",deleteUploadedSettingsConfirm:"確定要刪除後端上已上傳的設定嗎?此操作無法復原。",upgradeSuccess:"升級成功",numberOfChartsInSidebar:"側邊欄圖表數量",flushSmartWeights:"清空Smart權重",IPInfoAPI:"IP資訊API",IPInfoAPITip:"此API會用於IP檢查中全球節點IP資訊查詢、連接詳情中的IP地理資訊查詢、面板DNS查詢中的IP地理資訊查詢。",general:"通用",groupProxiesByProvider:"節點根據提供商分組",useSmartGroupSort:"Smart組根據使用頻率排序",all:"全部",autoDisconnectIdleUDP:"自動斷開空閒UDP",autoDisconnectIdleUDPTime:"UDP空閒時間",autoDisconnectIdleUDPTip:"啟用後,開啟zashboard時將關閉持續時間超過配置分鐘數的UDP連接,這可能對某些無法正常自動斷開的UDP連接帶來幫助。(這是作者自己的私貨,你大概率不需要開啟它)",customGlobalNode:"自訂全域節點",connectionTopology:"連接拓撲",editBackend:"編輯後端",editBackendTitle:"修改後端配置",selectBackend:"選擇後端",backendConnectionFailed:"後端連接失敗,請檢查配置資訊",backendConfigSaved:"後端配置儲存成功",saveFailed:"儲存失敗",checking:"檢查中...",copySuccess:"複製成功",importFromBackendTip:"預設的./zashboard-settings.json位於ui資料夾下,匯入前請確保ui資料夾下存在配置檔案。",importFailed:"匯入失敗,請檢查url {url}",autoImportFromUrl:"自動匯入",autoImportFromUrlTip:"啟用後,每次開啟zashboard時會自動從url設定匯入並計算hash,如果hash與上次匯入的hash不同,則重新匯入並重新整理頁面。",getting:"獲取中...",mmdbSizeTip:"mmdb等格式的geo檔案無法統計數量,因此數量為0",displayFinalOutbound:"顯示最終出口節點",groupTestUrls:"組測試連結",groupTestUrlsTip:"對於從面板手動觸發的測試,此處設定測試連結 > 配置中的連結 > 面板全域測試連結,但是對於UrlTest/Fallback等具有核心內部的定時測速邏輯的組,仍然需要修改配置中的連結,此處僅推薦Selector等場景",groupName:"組名",unknown:"未知",sourceIPAddress:"源IP地址",ruleMatch:"規則匹配",proxyChainEntry:"代理鏈入口",proxyChainExit:"代理鏈出口",nodeType:"節點類型",connectionCount:"連接數",zashboardSettings:"面板設置",backendSettings:"後端設置",generalSettings:"常規設置",overviewSettings:"概覽設置",overviewCardSettings:"卡片設置",chartsCard:"圖表卡片",networkCard:"網絡卡片",providerTrafficOverview:"提供商流量概覽",topologyCharts:"拓撲圖表",connectionHistory:"連接歷史",ruleHitCountCard:"規則命中統計",latency:"延遲",icon:"圖示",settingsVisibility:"設置項顯示控制",settingsMenuGeneral:"面板",settingsMenuBackend:"後端",settingsMenuProxies:"代理",settingsMenuConnections:"連接",settingsMenuOverview:"概覽",ports:"端口",actions:"操作",showAllPreset:"全部顯示",minimalPreset:"精簡顯示",settingsPageTwoColumns:"雙列佈局",moveUp:"上移",moveDown:"下移",aggregateBy:"聚合方式",aggregateBySourceIP:"按源IP",aggregateByDestination:"按目標地址",aggregateByProcess:"按進程",aggregateByOutbound:"按出站節點",totalTraffic:"總流量",total:"總計",clearConnectionHistory:"清空連接歷史",clearConnectionHistoryConfirm:"確定要清空所有連接歷史資料嗎?此操作不可恢復。",clearConnectionHistorySuccess:"連接歷史資料清空成功",autoCleanupInterval:"自動清理間隔",autoCleanupIntervalWeek:"每週",autoCleanupIntervalMonth:"每月",autoCleanupIntervalQuarter:"每季度",autoCleanupIntervalNever:"永不",remainingTraffic:"剩餘流量",ruleHitCount:"命中: {count} 次",ruleLastHit:"最後命中: {time}",ruleMissCount:"未命中: {count} 次",ruleLastMiss:"最後未命中: {time}",RarelyUsed:"很少使用",OccasionalUsed:"偶爾使用",MostUsed:"經常使用",proxyFolderMode:"資料夾模式",folderModeAuto:"自動",folderModeOn:"開啟",folderModeOff:"關閉",folder_all:"全部",folder_uncategorized:"未分類",folder_manage:"管理資料夾",folder_builtin_strategy:"策略組",folder_builtin_nodes:"節點組",folder_name:"資料夾名稱",folder_new_placeholder:"新資料夾名稱",folder_rules:"自動規則",folder_rule_auto:"自動",folder_rule_regex:"正則",folder_rule_exclude_regex:"排除正則",folder_auto_hasGroup:"包含子組",folder_auto_nodeOnly:"僅含節點",folder_add_rule:"新增規則",folder_manual_includes:"手動加入",folder_filter_placeholder:"搜尋代理組",folder_preview:"自動匹配的代理組",folder_no_matches:"沒有符合的代理組",folder_delete_confirm:"確認刪除資料夾「{name}」?"},dm=c0e({legacy:!1,locale:ru.value,fallbackLocale:Yo.EN_US,messages:{[Yo.EN_US]:_0e,[Yo.ZH_CN]:w0e,[Yo.ZH_TW]:x0e,[Yo.RU_RU]:S0e}}),T0e=dm.global.t,Bc=new Map;let lO=null;const E0e=e=>{lO=e},C0e=e=>{const t=Bc.get(e);t&&!t.isPaused&&(clearTimeout(t.timer),t.isPaused=!0,t.remainingTime=t.remainingTime-(Date.now()-t.startTime),t.progressBar.style.animationPlayState="paused")},I0e=e=>{const t=Bc.get(e);t&&t.isPaused&&(t.isPaused=!1,t.startTime=Date.now(),t.timer=setTimeout(()=>{Bc.delete(e),t.alert.remove()},t.remainingTime),t.progressBar.style.animationPlayState="running")},fU=(e,t,n,r)=>{let i=-1;t!==0&&(r&&(r.style.animation=`progressBar ${t}ms linear forwards`),i=setTimeout(()=>{n&&Bc.delete(n),e.remove()},t)),n&&r&&Bc.set(n,{alert:e,timer:i,progressBar:r,startTime:Date.now(),remainingTime:t,isPaused:!1})},A0e=(e,t)=>{if(t){const n=Bc.get(t);n&&(clearTimeout(n.timer),Bc.delete(t))}e.remove()},dU=(e,t,n,r,i)=>{e.className=`alert flex p-2 pr-5 relative ${r}`;const o=document.createElement("div");o.className="break-all whitespace-pre-wrap",o.innerHTML=T0e(t,n);const a=document.createElement("button");a.className="absolute top-0 right-0 btn btn-xs btn-circle btn-ghost",a.innerHTML=` + + + + `,a.addEventListener("click",()=>A0e(e,i));const s=document.createElement("div");s.className="absolute -bottom-2 left-1 right-1 h-1 bg-transparent rounded-lg overflow-hidden";const l=document.createElement("div");return l.className="h-full bg-primary/30 transition-all duration-100 ease-linear",l.style.width="100%",s.appendChild(l),e.innerHTML="",e.appendChild(o),e.appendChild(a),e.appendChild(s),e.addEventListener("mouseenter",()=>C0e(i)),e.addEventListener("mouseleave",()=>I0e(i)),l},tr=({content:e,params:t={},key:n,type:r="alert-warning",timeout:i=3e3})=>{const o=n||e;if(o&&Bc.has(o)){const{alert:l,timer:u}=Bc.get(o);clearTimeout(u);const c=dU(l,e,t,r,o);fU(l,i,o,c);return}const a=document.createElement("div"),s=dU(a,e,t,r,o);lO?.value?.insertBefore(a,lO?.value?.firstChild),fU(a,i,o,s)};var nb={exports:{}};var R0e=nb.exports,hU;function k0e(){return hU||(hU=1,(function(e,t){(function(){var n,r="4.18.1",i=200,o="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",s="Invalid `variable` option passed into `_.template`",l="Invalid `imports` option passed into `_.template`",u="__lodash_hash_undefined__",c=500,f="__lodash_placeholder__",h=1,d=2,p=4,v=1,y=2,m=1,b=2,S=4,w=8,x=16,T=32,C=64,P=128,k=256,L=512,O=30,M="...",F=800,U=16,X=1,$=2,W=3,G=1/0,Q=9007199254740991,ne=17976931348623157e292,re=NaN,pe=4294967295,ke=pe-1,Re=pe>>>1,Me=[["ary",P],["bind",m],["bindKey",b],["curry",w],["curryRight",x],["flip",L],["partial",T],["partialRight",C],["rearg",k]],be="[object Arguments]",fe="[object Array]",Le="[object AsyncFunction]",Ce="[object Boolean]",Ue="[object Date]",Be="[object DOMException]",Xe="[object Error]",J="[object Function]",ie="[object GeneratorFunction]",ge="[object Map]",Te="[object Number]",Oe="[object Null]",Z="[object Object]",oe="[object Promise]",ve="[object Proxy]",xe="[object RegExp]",Pe="[object Set]",ze="[object String]",de="[object Symbol]",Ie="[object Undefined]",it="[object WeakMap]",Y="[object WeakSet]",D="[object ArrayBuffer]",A="[object DataView]",H="[object Float32Array]",q="[object Float64Array]",le="[object Int8Array]",_e="[object Int16Array]",he="[object Int32Array]",Ge="[object Uint8Array]",He="[object Uint8ClampedArray]",rt="[object Uint16Array]",je="[object Uint32Array]",ut=/\b__p \+= '';/g,St=/\b(__p \+=) '' \+/g,Kt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,on=/&(?:amp|lt|gt|quot|#39);/g,zn=/[&<>"']/g,ra=RegExp(on.source),yi=RegExp(zn.source),si=/<%-([\s\S]+?)%>/g,Rd=/<%([\s\S]+?)%>/g,Rl=/<%=([\s\S]+?)%>/g,Kc=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,SS=/^\w*$/,ky=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iv=/[\\^$.*+?()[\]{}|]/g,Py=RegExp(iv.source),Dy=/^\s+/,kd=/\s/,t2=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,n2=/\{\n\/\* \[wrapped with (.+)\] \*/,Er=/,? & /,Zc=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,wS=/[()=,{}\[\]\/\s]/,xS=/\\(\\)?/g,Oy=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Ly=/\w*$/,TS=/^[-+]0x[0-9a-f]+$/i,r2=/^0b[01]+$/i,i2=/^\[object .+?Constructor\]$/,o2=/^0o[0-7]+$/i,a2=/^(?:0|[1-9]\d*)$/,kl=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Pd=/($^)/,Ou=/['\n\r\u2028\u2029\\]/g,ov="\\ud800-\\udfff",s2="\\u0300-\\u036f",ES="\\ufe20-\\ufe2f",CS="\\u20d0-\\u20ff",Dd=s2+ES+CS,av="\\u2700-\\u27bf",Od="a-z\\xdf-\\xf6\\xf8-\\xff",Jc="\\xac\\xb1\\xd7\\xf7",Ld="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ys="\\u2000-\\u206f",l2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",IS="A-Z\\xc0-\\xd6\\xd8-\\xde",Ny="\\ufe0e\\ufe0f",My=Jc+Ld+Ys+l2,Fy="['’]",AS="["+ov+"]",RS="["+My+"]",sv="["+Dd+"]",$y="\\d+",lv="["+av+"]",uv="["+Od+"]",ct="[^"+ov+My+$y+av+Od+IS+"]",se="\\ud83c[\\udffb-\\udfff]",Ne="(?:"+sv+"|"+se+")",lt="[^"+ov+"]",It="(?:\\ud83c[\\udde6-\\uddff]){2}",tn="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+IS+"]",Jr="\\u200d",Or="(?:"+uv+"|"+ct+")",ia="(?:"+cn+"|"+ct+")",oa="(?:"+Fy+"(?:d|ll|m|re|s|t|ve))?",cv="(?:"+Fy+"(?:D|LL|M|RE|S|T|VE))?",Pi=Ne+"?",y$="["+Ny+"]?",eoe="(?:"+Jr+"(?:"+[lt,It,tn].join("|")+")"+y$+Pi+")*",toe="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",noe="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",b$=y$+Pi+eoe,roe="(?:"+[lv,It,tn].join("|")+")"+b$,ioe="(?:"+[lt+sv+"?",sv,It,tn,AS].join("|")+")",ooe=RegExp(Fy,"g"),aoe=RegExp(sv,"g"),u2=RegExp(se+"(?="+se+")|"+ioe+b$,"g"),soe=RegExp([cn+"?"+uv+"+"+oa+"(?="+[RS,cn,"$"].join("|")+")",ia+"+"+cv+"(?="+[RS,cn+Or,"$"].join("|")+")",cn+"?"+Or+"+"+oa,cn+"+"+cv,noe,toe,$y,roe].join("|"),"g"),loe=RegExp("["+Jr+ov+Dd+Ny+"]"),uoe=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,coe=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],foe=-1,wr={};wr[H]=wr[q]=wr[le]=wr[_e]=wr[he]=wr[Ge]=wr[He]=wr[rt]=wr[je]=!0,wr[be]=wr[fe]=wr[D]=wr[Ce]=wr[A]=wr[Ue]=wr[Xe]=wr[J]=wr[ge]=wr[Te]=wr[Z]=wr[xe]=wr[Pe]=wr[ze]=wr[it]=!1;var gr={};gr[be]=gr[fe]=gr[D]=gr[A]=gr[Ce]=gr[Ue]=gr[H]=gr[q]=gr[le]=gr[_e]=gr[he]=gr[ge]=gr[Te]=gr[Z]=gr[xe]=gr[Pe]=gr[ze]=gr[de]=gr[Ge]=gr[He]=gr[rt]=gr[je]=!0,gr[Xe]=gr[J]=gr[it]=!1;var doe={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},hoe={"&":"&","<":"<",">":">",'"':""","'":"'"},poe={"&":"&","<":"<",">":">",""":'"',"'":"'"},voe={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},goe=parseFloat,moe=parseInt,_$=typeof Cw=="object"&&Cw&&Cw.Object===Object&&Cw,yoe=typeof self=="object"&&self&&self.Object===Object&&self,Gi=_$||yoe||Function("return this")(),c2=t&&!t.nodeType&&t,Nd=c2&&!0&&e&&!e.nodeType&&e,S$=Nd&&Nd.exports===c2,f2=S$&&_$.process,as=(function(){try{var Ee=Nd&&Nd.require&&Nd.require("util").types;return Ee||f2&&f2.binding&&f2.binding("util")}catch{}})(),w$=as&&as.isArrayBuffer,x$=as&&as.isDate,T$=as&&as.isMap,E$=as&&as.isRegExp,C$=as&&as.isSet,I$=as&&as.isTypedArray;function Na(Ee,We,Ve){switch(Ve.length){case 0:return Ee.call(We);case 1:return Ee.call(We,Ve[0]);case 2:return Ee.call(We,Ve[0],Ve[1]);case 3:return Ee.call(We,Ve[0],Ve[1],Ve[2])}return Ee.apply(We,Ve)}function boe(Ee,We,Ve,wt){for(var Jt=-1,Hn=Ee==null?0:Ee.length;++Jt-1}function d2(Ee,We,Ve){for(var wt=-1,Jt=Ee==null?0:Ee.length;++wt-1;);return Ve}function N$(Ee,We){for(var Ve=Ee.length;Ve--&&fv(We,Ee[Ve],0)>-1;);return Ve}function Aoe(Ee,We){for(var Ve=Ee.length,wt=0;Ve--;)Ee[Ve]===We&&++wt;return wt}var Roe=g2(doe),koe=g2(hoe);function Poe(Ee){return"\\"+voe[Ee]}function Doe(Ee,We){return Ee==null?n:Ee[We]}function dv(Ee){return loe.test(Ee)}function Ooe(Ee){return uoe.test(Ee)}function Loe(Ee){for(var We,Ve=[];!(We=Ee.next()).done;)Ve.push(We.value);return Ve}function _2(Ee){var We=-1,Ve=Array(Ee.size);return Ee.forEach(function(wt,Jt){Ve[++We]=[Jt,wt]}),Ve}function M$(Ee,We){return function(Ve){return Ee(We(Ve))}}function ef(Ee,We){for(var Ve=-1,wt=Ee.length,Jt=0,Hn=[];++Ve-1}function Sae(g,_){var E=this.__data__,N=jS(E,g);return N<0?(++this.size,E.push([g,_])):E[N][1]=_,this}Lu.prototype.clear=mae,Lu.prototype.delete=yae,Lu.prototype.get=bae,Lu.prototype.has=_ae,Lu.prototype.set=Sae;function Nu(g){var _=-1,E=g==null?0:g.length;for(this.clear();++_=_?g:_)),g}function us(g,_,E,N,z,te){var ce,ye=_&h,Ae=_&d,Ke=_&p;if(E&&(ce=z?E(g,N,z,te):E(g)),ce!==n)return ce;if(!Lr(g))return g;var Je=nn(g);if(Je){if(ce=Ese(g),!ye)return aa(g,ce)}else{var nt=so(g),pt=nt==J||nt==ie;if(sf(g))return y4(g,ye);if(nt==Z||nt==be||pt&&!z){if(ce=Ae||pt?{}:F4(g),!ye)return Ae?pse(g,Fae(ce,g)):hse(g,X$(ce,g))}else{if(!gr[nt])return z?g:{};ce=Cse(g,nt,ye)}}te||(te=new Xs);var kt=te.get(g);if(kt)return kt;te.set(g,ce),dB(g)?g.forEach(function($t){ce.add(us($t,_,E,$t,g,te))}):cB(g)&&g.forEach(function($t,_n){ce.set(_n,us($t,_,E,_n,g,te))});var Gt=Ke?Ae?Y2:z2:Ae?la:Di,fn=Je?n:Gt(g);return Ma(fn||g,function($t,_n){fn&&(_n=$t,$t=g[_n]),zy(ce,_n,us($t,_,E,_n,g,te))}),ce}function $ae(g){var _=Di(g);return function(E){return K$(E,g,_)}}function K$(g,_,E){var N=E.length;if(g==null)return!N;for(g=dr(g);N--;){var z=E[N],te=_[z],ce=g[z];if(ce===n&&!(z in g)||!te(ce))return!1}return!0}function Z$(g,_,E){if(typeof g!="function")throw new ss(a);return Qy(function(){g.apply(n,E)},_)}function Yy(g,_,E,N){var z=-1,te=kS,ce=!0,ye=g.length,Ae=[],Ke=_.length;if(!ye)return Ae;E&&(_=Cr(_,Fa(E))),N?(te=d2,ce=!1):_.length>=i&&(te=By,ce=!1,_=new $d(_));e:for(;++zz?0:z+E),N=N===n||N>z?z:ln(N),N<0&&(N+=z),N=E>N?0:pB(N);E0&&E(ye)?_>1?Hi(ye,_-1,E,N,z):qc(z,ye):N||(z[z.length]=ye)}return z}var I2=T4(),q$=T4(!0);function Dl(g,_){return g&&I2(g,_,Di)}function A2(g,_){return g&&q$(g,_,Di)}function KS(g,_){return Qc(_,function(E){return Bu(g[E])})}function Vd(g,_){_=of(_,g);for(var E=0,N=_.length;g!=null&&E_}function Uae(g,_){return g!=null&&Yn.call(g,_)}function Gae(g,_){return g!=null&&_ in dr(g)}function Hae(g,_,E){return g>=ao(_,E)&&g<_i(_,E)}function k2(g,_,E){for(var N=E?d2:kS,z=g[0].length,te=g.length,ce=te,ye=Ve(te),Ae=1/0,Ke=[];ce--;){var Je=g[ce];ce&&_&&(Je=Cr(Je,Fa(_))),Ae=ao(Je.length,Ae),ye[ce]=!E&&(_||z>=120&&Je.length>=120)?new $d(ce&&Je):n}Je=g[0];var nt=-1,pt=ye[0];e:for(;++nt-1;)ye!==g&&VS.call(ye,Ae,1),VS.call(g,Ae,1);return g}function c4(g,_){for(var E=g?_.length:0,N=E-1;E--;){var z=_[E];if(E==N||z!==te){var te=z;$u(z)?VS.call(g,z,1):$2(g,z)}}return g}function N2(g,_){return g+HS(W$()*(_-g+1))}function nse(g,_,E,N){for(var z=-1,te=_i(GS((_-g)/(E||1)),0),ce=Ve(te);te--;)ce[N?te:++z]=g,g+=E;return ce}function M2(g,_){var E="";if(!g||_<1||_>Q)return E;do _%2&&(E+=g),_=HS(_/2),_&&(g+=g);while(_);return E}function dn(g,_){return q2(V4(g,_,ua),g+"")}function rse(g){return j$(xv(g))}function ise(g,_){var E=xv(g);return aw(E,Bd(_,0,E.length))}function Ky(g,_,E,N){if(!Lr(g))return g;_=of(_,g);for(var z=-1,te=_.length,ce=te-1,ye=g;ye!=null&&++zz?0:z+_),E=E>z?z:E,E<0&&(E+=z),z=_>E?0:E-_>>>0,_>>>=0;for(var te=Ve(z);++N>>1,ce=g[te];ce!==null&&!Ba(ce)&&(E?ce<=_:ce<_)?N=te+1:z=te}return z}return F2(g,_,ua,E)}function F2(g,_,E,N){var z=0,te=g==null?0:g.length;if(te===0)return 0;_=E(_);for(var ce=_!==_,ye=_===null,Ae=Ba(_),Ke=_===n;z=i){var Ke=_?null:yse(g);if(Ke)return DS(Ke);ce=!1,z=By,Ae=new $d}else Ae=_?[]:ye;e:for(;++N=N?g:cs(g,_,E)}var m4=Koe||function(g){return Gi.clearTimeout(g)};function y4(g,_){if(_)return g.slice();var E=g.length,N=B$?B$(E):new g.constructor(E);return g.copy(N),N}function G2(g){var _=new g.constructor(g.byteLength);return new $S(_).set(new $S(g)),_}function use(g,_){var E=_?G2(g.buffer):g.buffer;return new g.constructor(E,g.byteOffset,g.byteLength)}function cse(g){var _=new g.constructor(g.source,Ly.exec(g));return _.lastIndex=g.lastIndex,_}function fse(g){return Wy?dr(Wy.call(g)):{}}function b4(g,_){var E=_?G2(g.buffer):g.buffer;return new g.constructor(E,g.byteOffset,g.length)}function _4(g,_){if(g!==_){var E=g!==n,N=g===null,z=g===g,te=Ba(g),ce=_!==n,ye=_===null,Ae=_===_,Ke=Ba(_);if(!ye&&!Ke&&!te&&g>_||te&&ce&&Ae&&!ye&&!Ke||N&&ce&&Ae||!E&&Ae||!z)return 1;if(!N&&!te&&!Ke&&g<_||Ke&&E&&z&&!N&&!te||ye&&E&&z||!ce&&z||!Ae)return-1}return 0}function dse(g,_,E){for(var N=-1,z=g.criteria,te=_.criteria,ce=z.length,ye=E.length;++N=ye)return Ae;var Ke=E[N];return Ae*(Ke=="desc"?-1:1)}}return g.index-_.index}function S4(g,_,E,N){for(var z=-1,te=g.length,ce=E.length,ye=-1,Ae=_.length,Ke=_i(te-ce,0),Je=Ve(Ae+Ke),nt=!N;++ye1?E[z-1]:n,ce=z>2?E[2]:n;for(te=g.length>3&&typeof te=="function"?(z--,te):n,ce&&Lo(E[0],E[1],ce)&&(te=z<3?n:te,z=1),_=dr(_);++N-1?z[te?_[ce]:ce]:n}}function I4(g){return Fu(function(_){var E=_.length,N=E,z=ls.prototype.thru;for(g&&_.reverse();N--;){var te=_[N];if(typeof te!="function")throw new ss(a);if(z&&!ce&&iw(te)=="wrapper")var ce=new ls([],!0)}for(N=ce?N:E;++N1&&Cn.reverse(),Je&&Ae<_n&&(Cn.length=Ae),this&&this!==Gi&&this instanceof $t&&(Uu=fn||Zy(Uu)),Uu.apply(Js,Cn)}return $t}function A4(g,_){return function(E,N){return Wae(E,g,_(N),{})}}function tw(g,_){return function(E,N){var z;if(E===n&&N===n)return _;if(E!==n&&(z=E),N!==n){if(z===n)return N;typeof E=="string"||typeof N=="string"?(E=$a(E),N=$a(N)):(E=h4(E),N=h4(N)),z=g(E,N)}return z}}function H2(g){return Fu(function(_){return _=Cr(_,Fa(Bt())),dn(function(E){var N=this;return g(_,function(z){return Na(z,N,E)})})})}function nw(g,_){_=_===n?" ":$a(_);var E=_.length;if(E<2)return E?M2(_,g):_;var N=M2(_,GS(g/hv(_)));return dv(_)?af(js(N),0,g).join(""):N.slice(0,g)}function mse(g,_,E,N){var z=_&m,te=Zy(g);function ce(){for(var ye=-1,Ae=arguments.length,Ke=-1,Je=N.length,nt=Ve(Je+Ae),pt=this&&this!==Gi&&this instanceof ce?te:g;++Keye))return!1;var Ke=te.get(g),Je=te.get(_);if(Ke&&Je)return Ke==_&&Je==g;var nt=-1,pt=!0,kt=E&y?new $d:n;for(te.set(g,_),te.set(_,g);++nt1?"& ":"")+_[N],_=_.join(E>2?", ":" "),g.replace(t2,`{ +/* [wrapped with `+_+`] */ +`)}function Ase(g){return nn(g)||Hd(g)||!!(G$&&g&&g[G$])}function $u(g,_){var E=typeof g;return _=_??Q,!!_&&(E=="number"||E!="symbol"&&a2.test(g))&&g>-1&&g%1==0&&g<_}function Lo(g,_,E){if(!Lr(E))return!1;var N=typeof _;return(N=="number"?sa(E)&&$u(_,E.length):N=="string"&&_ in E)?Zs(E[_],g):!1}function Z2(g,_){if(nn(g))return!1;var E=typeof g;return E=="number"||E=="symbol"||E=="boolean"||g==null||Ba(g)?!0:SS.test(g)||!Kc.test(g)||_!=null&&g in dr(_)}function Rse(g){var _=typeof g;return _=="string"||_=="number"||_=="symbol"||_=="boolean"?g!=="__proto__":g===null}function J2(g){var _=iw(g),E=ee[_];if(typeof E!="function"||!(_ in xn.prototype))return!1;if(g===E)return!0;var N=j2(E);return!!N&&g===N[0]}function kse(g){return!!$$&&$$ in g}var Pse=LS?Bu:vR;function Jy(g){var _=g&&g.constructor,E=typeof _=="function"&&_.prototype||vv;return g===E}function $4(g){return g===g&&!Lr(g)}function B4(g,_){return function(E){return E==null?!1:E[g]===_&&(_!==n||g in dr(E))}}function Dse(g){var _=cw(g,function(N){return E.size===c&&E.clear(),N}),E=_.cache;return _}function Ose(g,_){var E=g[1],N=_[1],z=E|N,te=z<(m|b|P),ce=N==P&&E==w||N==P&&E==k&&g[7].length<=_[8]||N==(P|k)&&_[7].length<=_[8]&&E==w;if(!(te||ce))return g;N&m&&(g[2]=_[2],z|=E&m?0:S);var ye=_[3];if(ye){var Ae=g[3];g[3]=Ae?S4(Ae,ye,_[4]):ye,g[4]=Ae?ef(g[3],f):_[4]}return ye=_[5],ye&&(Ae=g[5],g[5]=Ae?w4(Ae,ye,_[6]):ye,g[6]=Ae?ef(g[5],f):_[6]),ye=_[7],ye&&(g[7]=ye),N&P&&(g[8]=g[8]==null?_[8]:ao(g[8],_[8])),g[9]==null&&(g[9]=_[9]),g[0]=_[0],g[1]=z,g}function Lse(g){var _=[];if(g!=null)for(var E in dr(g))_.push(E);return _}function Nse(g){return MS.call(g)}function V4(g,_,E){return _=_i(_===n?g.length-1:_,0),function(){for(var N=arguments,z=-1,te=_i(N.length-_,0),ce=Ve(te);++z0){if(++_>=F)return arguments[0]}else _=0;return g.apply(n,arguments)}}function aw(g,_){var E=-1,N=g.length,z=N-1;for(_=_===n?N:_;++E<_;){var te=N2(E,z),ce=g[te];g[te]=g[E],g[E]=ce}return g.length=_,g}var z4=Dse(function(g){var _=[];return g.charCodeAt(0)===46&&_.push(""),g.replace(ky,function(E,N,z,te){_.push(z?te.replace(xS,"$1"):N||E)}),_});function Ks(g){if(typeof g=="string"||Ba(g))return g;var _=g+"";return _=="0"&&1/g==-G?"-0":_}function Gd(g){if(g!=null){try{return NS.call(g)}catch{}try{return g+""}catch{}}return""}function Fse(g,_){return Ma(Me,function(E){var N="_."+E[0];_&E[1]&&!kS(g,N)&&g.push(N)}),g.sort()}function Y4(g){if(g instanceof xn)return g.clone();var _=new ls(g.__wrapped__,g.__chain__);return _.__actions__=aa(g.__actions__),_.__index__=g.__index__,_.__values__=g.__values__,_}function $se(g,_,E){(E?Lo(g,_,E):_===n)?_=1:_=_i(ln(_),0);var N=g==null?0:g.length;if(!N||_<1)return[];for(var z=0,te=0,ce=Ve(GS(N/_));z1?g[_-1]:n;return E=typeof E=="function"?(g.pop(),E):n,Q4(g,E)});function q4(g){var _=ee(g);return _.__chain__=!0,_}function Ble(g,_){return _(g),g}function sw(g,_){return _(g)}var Vle=Fu(function(g){var _=g.length,E=_?g[0]:0,N=this.__wrapped__,z=function(te){return C2(te,g)};return _>1||this.__actions__.length||!(N instanceof xn)||!$u(E)?this.thru(z):(N=N.slice(E,+E+(_?1:0)),N.__actions__.push({func:sw,args:[z],thisArg:n}),new ls(N,this.__chain__).thru(function(te){return _&&!te.length&&te.push(n),te}))});function Ule(){return q4(this)}function Gle(){return new ls(this.value(),this.__chain__)}function Hle(){this.__values__===n&&(this.__values__=hB(this.value()));var g=this.__index__>=this.__values__.length,_=g?n:this.__values__[this.__index__++];return{done:g,value:_}}function Wle(){return this}function zle(g){for(var _,E=this;E instanceof YS;){var N=Y4(E);N.__index__=0,N.__values__=n,_?z.__wrapped__=N:_=N;var z=N;E=E.__wrapped__}return z.__wrapped__=g,_}function Yle(){var g=this.__wrapped__;if(g instanceof xn){var _=g;return this.__actions__.length&&(_=new xn(this)),_=_.reverse(),_.__actions__.push({func:sw,args:[eR],thisArg:n}),new ls(_,this.__chain__)}return this.thru(eR)}function jle(){return v4(this.__wrapped__,this.__actions__)}var Xle=qS(function(g,_,E){Yn.call(g,E)?++g[E]:Pl(g,E,1)});function Kle(g,_,E){var N=nn(g)?A$:Bae;return E&&Lo(g,_,E)&&(_=n),N(g,Bt(_,3))}function Zle(g,_){var E=nn(g)?Qc:Q$;return E(g,Bt(_,3))}var Jle=C4(j4),Qle=C4(X4);function qle(g,_){return Hi(lw(g,_),1)}function eue(g,_){return Hi(lw(g,_),G)}function tue(g,_,E){return E=E===n?1:ln(E),Hi(lw(g,_),E)}function eB(g,_){var E=nn(g)?Ma:nf;return E(g,Bt(_,3))}function tB(g,_){var E=nn(g)?_oe:J$;return E(g,Bt(_,3))}var nue=qS(function(g,_,E){Yn.call(g,E)?g[E].push(_):Pl(g,E,[_])});function rue(g,_,E,N){g=sa(g)?g:xv(g),E=E&&!N?ln(E):0;var z=g.length;return E<0&&(E=_i(z+E,0)),hw(g)?E<=z&&g.indexOf(_,E)>-1:!!z&&fv(g,_,E)>-1}var iue=dn(function(g,_,E){var N=-1,z=typeof _=="function",te=sa(g)?Ve(g.length):[];return nf(g,function(ce){te[++N]=z?Na(_,ce,E):jy(ce,_,E)}),te}),oue=qS(function(g,_,E){Pl(g,E,_)});function lw(g,_){var E=nn(g)?Cr:i4;return E(g,Bt(_,3))}function aue(g,_,E,N){return g==null?[]:(nn(_)||(_=_==null?[]:[_]),E=N?n:E,nn(E)||(E=E==null?[]:[E]),l4(g,_,E))}var sue=qS(function(g,_,E){g[E?0:1].push(_)},function(){return[[],[]]});function lue(g,_,E){var N=nn(g)?h2:D$,z=arguments.length<3;return N(g,Bt(_,4),E,z,nf)}function uue(g,_,E){var N=nn(g)?Soe:D$,z=arguments.length<3;return N(g,Bt(_,4),E,z,J$)}function cue(g,_){var E=nn(g)?Qc:Q$;return E(g,fw(Bt(_,3)))}function fue(g){var _=nn(g)?j$:rse;return _(g)}function due(g,_,E){(E?Lo(g,_,E):_===n)?_=1:_=ln(_);var N=nn(g)?Lae:ise;return N(g,_)}function hue(g){var _=nn(g)?Nae:ase;return _(g)}function pue(g){if(g==null)return 0;if(sa(g))return hw(g)?hv(g):g.length;var _=so(g);return _==ge||_==Pe?g.size:D2(g).length}function vue(g,_,E){var N=nn(g)?p2:sse;return E&&Lo(g,_,E)&&(_=n),N(g,Bt(_,3))}var gue=dn(function(g,_){if(g==null)return[];var E=_.length;return E>1&&Lo(g,_[0],_[1])?_=[]:E>2&&Lo(_[0],_[1],_[2])&&(_=[_[0]]),l4(g,Hi(_,1),[])}),uw=Zoe||function(){return Gi.Date.now()};function mue(g,_){if(typeof _!="function")throw new ss(a);return g=ln(g),function(){if(--g<1)return _.apply(this,arguments)}}function nB(g,_,E){return _=E?n:_,_=g&&_==null?g.length:_,Mu(g,P,n,n,n,n,_)}function rB(g,_){var E;if(typeof _!="function")throw new ss(a);return g=ln(g),function(){return--g>0&&(E=_.apply(this,arguments)),g<=1&&(_=n),E}}var nR=dn(function(g,_,E){var N=m;if(E.length){var z=ef(E,Sv(nR));N|=T}return Mu(g,N,_,E,z)}),iB=dn(function(g,_,E){var N=m|b;if(E.length){var z=ef(E,Sv(iB));N|=T}return Mu(_,N,g,E,z)});function oB(g,_,E){_=E?n:_;var N=Mu(g,w,n,n,n,n,n,_);return N.placeholder=oB.placeholder,N}function aB(g,_,E){_=E?n:_;var N=Mu(g,x,n,n,n,n,n,_);return N.placeholder=aB.placeholder,N}function sB(g,_,E){var N,z,te,ce,ye,Ae,Ke=0,Je=!1,nt=!1,pt=!0;if(typeof g!="function")throw new ss(a);_=ds(_)||0,Lr(E)&&(Je=!!E.leading,nt="maxWait"in E,te=nt?_i(ds(E.maxWait)||0,_):te,pt="trailing"in E?!!E.trailing:pt);function kt(qr){var Js=N,Uu=z;return N=z=n,Ke=qr,ce=g.apply(Uu,Js),ce}function Gt(qr){return Ke=qr,ye=Qy(_n,_),Je?kt(qr):ce}function fn(qr){var Js=qr-Ae,Uu=qr-Ke,IB=_-Js;return nt?ao(IB,te-Uu):IB}function $t(qr){var Js=qr-Ae,Uu=qr-Ke;return Ae===n||Js>=_||Js<0||nt&&Uu>=te}function _n(){var qr=uw();if($t(qr))return Cn(qr);ye=Qy(_n,fn(qr))}function Cn(qr){return ye=n,pt&&N?kt(qr):(N=z=n,ce)}function Va(){ye!==n&&m4(ye),Ke=0,N=Ae=z=ye=n}function No(){return ye===n?ce:Cn(uw())}function Ua(){var qr=uw(),Js=$t(qr);if(N=arguments,z=this,Ae=qr,Js){if(ye===n)return Gt(Ae);if(nt)return m4(ye),ye=Qy(_n,_),kt(Ae)}return ye===n&&(ye=Qy(_n,_)),ce}return Ua.cancel=Va,Ua.flush=No,Ua}var yue=dn(function(g,_){return Z$(g,1,_)}),bue=dn(function(g,_,E){return Z$(g,ds(_)||0,E)});function _ue(g){return Mu(g,L)}function cw(g,_){if(typeof g!="function"||_!=null&&typeof _!="function")throw new ss(a);var E=function(){var N=arguments,z=_?_.apply(this,N):N[0],te=E.cache;if(te.has(z))return te.get(z);var ce=g.apply(this,N);return E.cache=te.set(z,ce)||te,ce};return E.cache=new(cw.Cache||Nu),E}cw.Cache=Nu;function fw(g){if(typeof g!="function")throw new ss(a);return function(){var _=arguments;switch(_.length){case 0:return!g.call(this);case 1:return!g.call(this,_[0]);case 2:return!g.call(this,_[0],_[1]);case 3:return!g.call(this,_[0],_[1],_[2])}return!g.apply(this,_)}}function Sue(g){return rB(2,g)}var wue=lse(function(g,_){_=_.length==1&&nn(_[0])?Cr(_[0],Fa(Bt())):Cr(Hi(_,1),Fa(Bt()));var E=_.length;return dn(function(N){for(var z=-1,te=ao(N.length,E);++z=_}),Hd=t4((function(){return arguments})())?t4:function(g){return Vr(g)&&Yn.call(g,"callee")&&!U$.call(g,"callee")},nn=Ve.isArray,Fue=w$?Fa(w$):zae;function sa(g){return g!=null&&dw(g.length)&&!Bu(g)}function Qr(g){return Vr(g)&&sa(g)}function $ue(g){return g===!0||g===!1||Vr(g)&&Oo(g)==Ce}var sf=Qoe||vR,Bue=x$?Fa(x$):Yae;function Vue(g){return Vr(g)&&g.nodeType===1&&!qy(g)}function Uue(g){if(g==null)return!0;if(sa(g)&&(nn(g)||typeof g=="string"||typeof g.splice=="function"||sf(g)||wv(g)||Hd(g)))return!g.length;var _=so(g);if(_==ge||_==Pe)return!g.size;if(Jy(g))return!D2(g).length;for(var E in g)if(Yn.call(g,E))return!1;return!0}function Gue(g,_){return Xy(g,_)}function Hue(g,_,E){E=typeof E=="function"?E:n;var N=E?E(g,_):n;return N===n?Xy(g,_,n,E):!!N}function iR(g){if(!Vr(g))return!1;var _=Oo(g);return _==Xe||_==Be||typeof g.message=="string"&&typeof g.name=="string"&&!qy(g)}function Wue(g){return typeof g=="number"&&H$(g)}function Bu(g){if(!Lr(g))return!1;var _=Oo(g);return _==J||_==ie||_==Le||_==ve}function uB(g){return typeof g=="number"&&g==ln(g)}function dw(g){return typeof g=="number"&&g>-1&&g%1==0&&g<=Q}function Lr(g){var _=typeof g;return g!=null&&(_=="object"||_=="function")}function Vr(g){return g!=null&&typeof g=="object"}var cB=T$?Fa(T$):Xae;function zue(g,_){return g===_||P2(g,_,X2(_))}function Yue(g,_,E){return E=typeof E=="function"?E:n,P2(g,_,X2(_),E)}function jue(g){return fB(g)&&g!=+g}function Xue(g){if(Pse(g))throw new Jt(o);return n4(g)}function Kue(g){return g===null}function Zue(g){return g==null}function fB(g){return typeof g=="number"||Vr(g)&&Oo(g)==Te}function qy(g){if(!Vr(g)||Oo(g)!=Z)return!1;var _=BS(g);if(_===null)return!0;var E=Yn.call(_,"constructor")&&_.constructor;return typeof E=="function"&&E instanceof E&&NS.call(E)==Yoe}var oR=E$?Fa(E$):Kae;function Jue(g){return uB(g)&&g>=-Q&&g<=Q}var dB=C$?Fa(C$):Zae;function hw(g){return typeof g=="string"||!nn(g)&&Vr(g)&&Oo(g)==ze}function Ba(g){return typeof g=="symbol"||Vr(g)&&Oo(g)==de}var wv=I$?Fa(I$):Jae;function Que(g){return g===n}function que(g){return Vr(g)&&so(g)==it}function ece(g){return Vr(g)&&Oo(g)==Y}var tce=rw(O2),nce=rw(function(g,_){return g<=_});function hB(g){if(!g)return[];if(sa(g))return hw(g)?js(g):aa(g);if(Vy&&g[Vy])return Loe(g[Vy]());var _=so(g),E=_==ge?_2:_==Pe?DS:xv;return E(g)}function Vu(g){if(!g)return g===0?g:0;if(g=ds(g),g===G||g===-G){var _=g<0?-1:1;return _*ne}return g===g?g:0}function ln(g){var _=Vu(g),E=_%1;return _===_?E?_-E:_:0}function pB(g){return g?Bd(ln(g),0,pe):0}function ds(g){if(typeof g=="number")return g;if(Ba(g))return re;if(Lr(g)){var _=typeof g.valueOf=="function"?g.valueOf():g;g=Lr(_)?_+"":_}if(typeof g!="string")return g===0?g:+g;g=O$(g);var E=r2.test(g);return E||o2.test(g)?moe(g.slice(2),E?2:8):TS.test(g)?re:+g}function vB(g){return Ol(g,la(g))}function rce(g){return g?Bd(ln(g),-Q,Q):g===0?g:0}function jn(g){return g==null?"":$a(g)}var ice=bv(function(g,_){if(Jy(_)||sa(_)){Ol(_,Di(_),g);return}for(var E in _)Yn.call(_,E)&&zy(g,E,_[E])}),gB=bv(function(g,_){Ol(_,la(_),g)}),mB=bv(function(g,_,E,N){Ol(_,la(_),g,N)}),aR=bv(function(g,_,E,N){Ol(_,Di(_),g,N)}),oce=Fu(C2);function ace(g,_){var E=yv(g);return _==null?E:X$(E,_)}var sce=dn(function(g,_){g=dr(g);var E=-1,N=_.length,z=N>2?_[2]:n;for(z&&Lo(_[0],_[1],z)&&(N=1);++E1),te}),Ol(g,Y2(g),E),N&&(E=us(E,h|d|p,bse));for(var z=_.length;z--;)$2(E,_[z]);return E});function Ece(g,_){return bB(g,fw(Bt(_)))}var Cce=Fu(function(g,_){return g==null?{}:ese(g,_)});function bB(g,_){if(g==null)return{};var E=Cr(Y2(g),function(N){return[N]});return _=Bt(_),u4(g,E,function(N,z){return _(N,z[0])})}function Ice(g,_,E){_=of(_,g);var N=-1,z=_.length;for(z||(z=1,g=n);++N_){var N=g;g=_,_=N}if(E||g%1||_%1){var z=W$();return ao(g+z*(_-g+goe("1e-"+((z+"").length-1))),_)}return N2(g,_)}var $ce=_v(function(g,_,E){return _=_.toLowerCase(),g+(E?wB(_):_)});function wB(g){return uR(jn(g).toLowerCase())}function xB(g){return g=jn(g),g&&g.replace(kl,Roe).replace(aoe,"")}function Bce(g,_,E){g=jn(g),_=$a(_);var N=g.length;E=E===n?N:Bd(ln(E),0,N);var z=E;return E-=_.length,E>=0&&g.slice(E,z)==_}function Vce(g){return g=jn(g),g&&yi.test(g)?g.replace(zn,koe):g}function Uce(g){return g=jn(g),g&&Py.test(g)?g.replace(iv,"\\$&"):g}var Gce=_v(function(g,_,E){return g+(E?"-":"")+_.toLowerCase()}),Hce=_v(function(g,_,E){return g+(E?" ":"")+_.toLowerCase()}),Wce=E4("toLowerCase");function zce(g,_,E){g=jn(g),_=ln(_);var N=_?hv(g):0;if(!_||N>=_)return g;var z=(_-N)/2;return nw(HS(z),E)+g+nw(GS(z),E)}function Yce(g,_,E){g=jn(g),_=ln(_);var N=_?hv(g):0;return _&&N<_?g+nw(_-N,E):g}function jce(g,_,E){g=jn(g),_=ln(_);var N=_?hv(g):0;return _&&N<_?nw(_-N,E)+g:g}function Xce(g,_,E){return E||_==null?_=0:_&&(_=+_),nae(jn(g).replace(Dy,""),_||0)}function Kce(g,_,E){return(E?Lo(g,_,E):_===n)?_=1:_=ln(_),M2(jn(g),_)}function Zce(){var g=arguments,_=jn(g[0]);return g.length<3?_:_.replace(g[1],g[2])}var Jce=_v(function(g,_,E){return g+(E?"_":"")+_.toLowerCase()});function Qce(g,_,E){return E&&typeof E!="number"&&Lo(g,_,E)&&(_=E=n),E=E===n?pe:E>>>0,E?(g=jn(g),g&&(typeof _=="string"||_!=null&&!oR(_))&&(_=$a(_),!_&&dv(g))?af(js(g),0,E):g.split(_,E)):[]}var qce=_v(function(g,_,E){return g+(E?" ":"")+uR(_)});function efe(g,_,E){return g=jn(g),E=E==null?0:Bd(ln(E),0,g.length),_=$a(_),g.slice(E,E+_.length)==_}function tfe(g,_,E){var N=ee.templateSettings;E&&Lo(g,_,E)&&(_=n),g=jn(g),_=aR({},_,N,D4);var z=aR({},_.imports,N.imports,D4),te=Di(z),ce=b2(z,te);Ma(te,function($t){if(wS.test($t))throw new Jt(l)});var ye,Ae,Ke=0,Je=_.interpolate||Pd,nt="__p += '",pt=S2((_.escape||Pd).source+"|"+Je.source+"|"+(Je===Rl?Oy:Pd).source+"|"+(_.evaluate||Pd).source+"|$","g"),kt="//# sourceURL="+(Yn.call(_,"sourceURL")?(_.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++foe+"]")+` +`;g.replace(pt,function($t,_n,Cn,Va,No,Ua){return Cn||(Cn=Va),nt+=g.slice(Ke,Ua).replace(Ou,Poe),_n&&(ye=!0,nt+=`' + +__e(`+_n+`) + +'`),No&&(Ae=!0,nt+=`'; +`+No+`; +__p += '`),Cn&&(nt+=`' + +((__t = (`+Cn+`)) == null ? '' : __t) + +'`),Ke=Ua+$t.length,$t}),nt+=`'; +`;var Gt=Yn.call(_,"variable")&&_.variable;if(!Gt)nt=`with (obj) { +`+nt+` +} +`;else if(wS.test(Gt))throw new Jt(s);nt=(Ae?nt.replace(ut,""):nt).replace(St,"$1").replace(Kt,"$1;"),nt="function("+(Gt||"obj")+`) { +`+(Gt?"":`obj || (obj = {}); +`)+"var __t, __p = ''"+(ye?", __e = _.escape":"")+(Ae?`, __j = Array.prototype.join; +function print() { __p += __j.call(arguments, '') } +`:`; +`)+nt+`return __p +}`;var fn=EB(function(){return Hn(te,kt+"return "+nt).apply(n,ce)});if(fn.source=nt,iR(fn))throw fn;return fn}function nfe(g){return jn(g).toLowerCase()}function rfe(g){return jn(g).toUpperCase()}function ife(g,_,E){if(g=jn(g),g&&(E||_===n))return O$(g);if(!g||!(_=$a(_)))return g;var N=js(g),z=js(_),te=L$(N,z),ce=N$(N,z)+1;return af(N,te,ce).join("")}function ofe(g,_,E){if(g=jn(g),g&&(E||_===n))return g.slice(0,F$(g)+1);if(!g||!(_=$a(_)))return g;var N=js(g),z=N$(N,js(_))+1;return af(N,0,z).join("")}function afe(g,_,E){if(g=jn(g),g&&(E||_===n))return g.replace(Dy,"");if(!g||!(_=$a(_)))return g;var N=js(g),z=L$(N,js(_));return af(N,z).join("")}function sfe(g,_){var E=O,N=M;if(Lr(_)){var z="separator"in _?_.separator:z;E="length"in _?ln(_.length):E,N="omission"in _?$a(_.omission):N}g=jn(g);var te=g.length;if(dv(g)){var ce=js(g);te=ce.length}if(E>=te)return g;var ye=E-hv(N);if(ye<1)return N;var Ae=ce?af(ce,0,ye).join(""):g.slice(0,ye);if(z===n)return Ae+N;if(ce&&(ye+=Ae.length-ye),oR(z)){if(g.slice(ye).search(z)){var Ke,Je=Ae;for(z.global||(z=S2(z.source,jn(Ly.exec(z))+"g")),z.lastIndex=0;Ke=z.exec(Je);)var nt=Ke.index;Ae=Ae.slice(0,nt===n?ye:nt)}}else if(g.indexOf($a(z),ye)!=ye){var pt=Ae.lastIndexOf(z);pt>-1&&(Ae=Ae.slice(0,pt))}return Ae+N}function lfe(g){return g=jn(g),g&&ra.test(g)?g.replace(on,$oe):g}var ufe=_v(function(g,_,E){return g+(E?" ":"")+_.toUpperCase()}),uR=E4("toUpperCase");function TB(g,_,E){return g=jn(g),_=E?n:_,_===n?Ooe(g)?Uoe(g):Toe(g):g.match(_)||[]}var EB=dn(function(g,_){try{return Na(g,n,_)}catch(E){return iR(E)?E:new Jt(E)}}),cfe=Fu(function(g,_){return Ma(_,function(E){E=Ks(E),Pl(g,E,nR(g[E],g))}),g});function ffe(g){var _=g==null?0:g.length,E=Bt();return g=_?Cr(g,function(N){if(typeof N[1]!="function")throw new ss(a);return[E(N[0]),N[1]]}):[],dn(function(N){for(var z=-1;++z<_;){var te=g[z];if(Na(te[0],this,N))return Na(te[1],this,N)}})}function dfe(g){return $ae(us(g,h))}function cR(g){return function(){return g}}function hfe(g,_){return g==null||g!==g?_:g}var pfe=I4(),vfe=I4(!0);function ua(g){return g}function fR(g){return r4(typeof g=="function"?g:us(g,h))}function gfe(g){return o4(us(g,h))}function mfe(g,_){return a4(g,us(_,h))}var yfe=dn(function(g,_){return function(E){return jy(E,g,_)}}),bfe=dn(function(g,_){return function(E){return jy(g,E,_)}});function dR(g,_,E){var N=Di(_),z=KS(_,N);E==null&&!(Lr(_)&&(z.length||!N.length))&&(E=_,_=g,g=this,z=KS(_,Di(_)));var te=!(Lr(E)&&"chain"in E)||!!E.chain,ce=Bu(g);return Ma(z,function(ye){var Ae=_[ye];g[ye]=Ae,ce&&(g.prototype[ye]=function(){var Ke=this.__chain__;if(te||Ke){var Je=g(this.__wrapped__),nt=Je.__actions__=aa(this.__actions__);return nt.push({func:Ae,args:arguments,thisArg:g}),Je.__chain__=Ke,Je}return Ae.apply(g,qc([this.value()],arguments))})}),g}function _fe(){return Gi._===this&&(Gi._=joe),this}function hR(){}function Sfe(g){return g=ln(g),dn(function(_){return s4(_,g)})}var wfe=H2(Cr),xfe=H2(A$),Tfe=H2(p2);function CB(g){return Z2(g)?v2(Ks(g)):tse(g)}function Efe(g){return function(_){return g==null?n:Vd(g,_)}}var Cfe=R4(),Ife=R4(!0);function pR(){return[]}function vR(){return!1}function Afe(){return{}}function Rfe(){return""}function kfe(){return!0}function Pfe(g,_){if(g=ln(g),g<1||g>Q)return[];var E=pe,N=ao(g,pe);_=Bt(_),g-=pe;for(var z=y2(N,_);++E0||_<0)?new xn(E):(g<0?E=E.takeRight(-g):g&&(E=E.drop(g)),_!==n&&(_=ln(_),E=_<0?E.dropRight(-_):E.take(_-g)),E)},xn.prototype.takeRightWhile=function(g){return this.reverse().takeWhile(g).reverse()},xn.prototype.toArray=function(){return this.take(pe)},Dl(xn.prototype,function(g,_){var E=/^(?:filter|find|map|reject)|While$/.test(_),N=/^(?:head|last)$/.test(_),z=ee[N?"take"+(_=="last"?"Right":""):_],te=N||/^find/.test(_);z&&(ee.prototype[_]=function(){var ce=this.__wrapped__,ye=N?[1]:arguments,Ae=ce instanceof xn,Ke=ye[0],Je=Ae||nn(ce),nt=function(_n){var Cn=z.apply(ee,qc([_n],ye));return N&&pt?Cn[0]:Cn};Je&&E&&typeof Ke=="function"&&Ke.length!=1&&(Ae=Je=!1);var pt=this.__chain__,kt=!!this.__actions__.length,Gt=te&&!pt,fn=Ae&&!kt;if(!te&&Je){ce=fn?ce:new xn(this);var $t=g.apply(ce,ye);return $t.__actions__.push({func:sw,args:[nt],thisArg:n}),new ls($t,pt)}return Gt&&fn?g.apply(this,ye):($t=this.thru(nt),Gt?N?$t.value()[0]:$t.value():$t)})}),Ma(["pop","push","shift","sort","splice","unshift"],function(g){var _=OS[g],E=/^(?:push|sort|unshift)$/.test(g)?"tap":"thru",N=/^(?:pop|shift)$/.test(g);ee.prototype[g]=function(){var z=arguments;if(N&&!this.__chain__){var te=this.value();return _.apply(nn(te)?te:[],z)}return this[E](function(ce){return _.apply(nn(ce)?ce:[],z)})}}),Dl(xn.prototype,function(g,_){var E=ee[_];if(E){var N=E.name+"";Yn.call(mv,N)||(mv[N]=[]),mv[N].push({name:_,func:E})}}),mv[ew(n,b).name]=[{name:"wrapper",func:n}],xn.prototype.clone=uae,xn.prototype.reverse=cae,xn.prototype.value=fae,ee.prototype.at=Vle,ee.prototype.chain=Ule,ee.prototype.commit=Gle,ee.prototype.next=Hle,ee.prototype.plant=zle,ee.prototype.reverse=Yle,ee.prototype.toJSON=ee.prototype.valueOf=ee.prototype.value=jle,ee.prototype.first=ee.prototype.head,Vy&&(ee.prototype[Vy]=Wle),ee}),pv=Goe();Nd?((Nd.exports=pv)._=pv,c2._=pv):Gi._=pv}).call(R0e)})(nb,nb.exports)),nb.exports}var Jn=k0e();const Wi=[];for(let e=0;e<256;++e)Wi.push((e+256).toString(16).slice(1));function P0e(e,t=0){return(Wi[e[t+0]]+Wi[e[t+1]]+Wi[e[t+2]]+Wi[e[t+3]]+"-"+Wi[e[t+4]]+Wi[e[t+5]]+"-"+Wi[e[t+6]]+Wi[e[t+7]]+"-"+Wi[e[t+8]]+Wi[e[t+9]]+"-"+Wi[e[t+10]]+Wi[e[t+11]]+Wi[e[t+12]]+Wi[e[t+13]]+Wi[e[t+14]]+Wi[e[t+15]]).toLowerCase()}const D0e=new Uint8Array(16);function O0e(){return crypto.getRandomValues(D0e)}function Zp(e,t,n){return crypto.randomUUID?crypto.randomUUID():L0e(e)}function L0e(e,t,n){e=e||{};const r=e.random??e.rng?.()??O0e();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=r[6]&15|64,r[8]=r[8]&63|128,P0e(r)}const N0e=e=>{const t=[];for(const n of e){const r=n.singboxChannel,i=Jn.omit(n,"singboxChannel");t.push({...i,type:i.type??"clash"}),r?.host&&t.push({type:"singbox",protocol:r.protocol||"http",host:r.host,port:r.port||"9090",secondaryPath:"",password:r.secret||"",uuid:Zp(),label:i.label?`${i.label} (sing-box)`:void 0})}return t},Vn=Qe("setup/api-list",[]);Vn.value.some(e=>!e.type||"singboxChannel"in e)&&(Vn.value=N0e(Vn.value));const pg=me(!1),M0e=()=>{pg.value=!pg.value},Ii=Qe("setup/active-uuid",""),Sn=ae(()=>Vn.value.find(e=>e.uuid===Ii.value)),F0e=e=>{if(Vn.value.length<2)return null;const t=Vn.value.findIndex(o=>o.uuid===Ii.value),r=((t>=0?t:0)+e+Vn.value.length)%Vn.value.length,i=Vn.value[r];return i?(Ii.value=i.uuid,i):null},$0e=e=>{const t=Vn.value.find(r=>Jn.isEqual(Jn.omit(r,"uuid"),e));if(t){Ii.value=t.uuid;return}const n=Zp();Vn.value.push({...e,uuid:n}),Ii.value=n},B0e=(e,t)=>{const n=Vn.value.findIndex(r=>r.uuid===e);n!==-1&&(Vn.value[n]={...t,uuid:e})},V0e=e=>{Vn.value=Vn.value.filter(t=>t.uuid!==e),Ti.value.forEach(t=>{t.scope&&t.scope.includes(e)&&(t.scope=t.scope.filter(n=>n!==e),t.scope.length||delete t.scope)})};function eK(e,t){return function(){return e.apply(t,arguments)}}const{toString:U0e}=Object.prototype,{getPrototypeOf:hm}=Object,{iterator:Y_,toStringTag:tK}=Symbol,UE=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),R1=(e,t)=>{let n=e;const r=[];for(;n!=null&&n!==Object.prototype;){if(r.indexOf(n)!==-1)return!1;if(r.push(n),UE(n,t))return!0;n=hm(n)}return!1},G0e=(e,t)=>e!=null&&R1(e,t)?e[t]:void 0,LM=(e=>t=>{const n=U0e.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Sl=e=>(e=e.toLowerCase(),t=>LM(t)===e),DI=e=>t=>typeof t===e,{isArray:Tp}=Array,pm=DI("undefined");function cy(e){return e!==null&&!pm(e)&&e.constructor!==null&&!pm(e.constructor)&&Aa(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const nK=Sl("ArrayBuffer");function H0e(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&nK(e.buffer),t}const W0e=DI("string"),Aa=DI("function"),rK=DI("number"),fy=e=>e!==null&&typeof e=="object",z0e=e=>e===!0||e===!1,bT=e=>{if(!fy(e))return!1;const t=hm(e);return(t===null||t===Object.prototype||hm(t)===null)&&!R1(e,tK)&&!R1(e,Y_)},Y0e=e=>{if(!fy(e)||cy(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},j0e=Sl("Date"),X0e=Sl("File"),K0e=e=>!!(e&&typeof e.uri<"u"),Z0e=e=>e&&typeof e.getParts<"u",J0e=Sl("Blob"),Q0e=Sl("FileList"),q0e=e=>fy(e)&&Aa(e.pipe);function ebe(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}}const pU=ebe(),vU=typeof pU.FormData<"u"?pU.FormData:void 0,tbe=e=>{if(!e)return!1;if(vU&&e instanceof vU)return!0;const t=hm(e);if(!t||t===Object.prototype||!Aa(e.append))return!1;const n=LM(e);return n==="formdata"||n==="object"&&Aa(e.toString)&&e.toString()==="[object FormData]"},nbe=Sl("URLSearchParams"),[rbe,ibe,obe,abe]=["ReadableStream","Request","Response","Headers"].map(Sl),sbe=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function j_(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,i;if(typeof e!="object"&&(e=[e]),Tp(e))for(r=0,i=e.length;r0;)if(i=n[r],t===i.toLowerCase())return i;return null}const Hh=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,oK=e=>!pm(e)&&e!==Hh;function uO(...e){const{caseless:t,skipUndefined:n}=oK(this)&&this||{},r={},i=(o,a)=>{if(a==="__proto__"||a==="constructor"||a==="prototype")return;const s=t&&typeof a=="string"&&iK(r,a)||a,l=UE(r,s)?r[s]:void 0;bT(l)&&bT(o)?r[s]=uO(l,o):bT(o)?r[s]=uO({},o):Tp(o)?r[s]=o.slice():(!n||!pm(o))&&(r[s]=o)};for(let o=0,a=e.length;o(j_(t,(i,o)=>{n&&Aa(i)?Object.defineProperty(e,o,{__proto__:null,value:eK(i,n),writable:!0,enumerable:!0,configurable:!0}):Object.defineProperty(e,o,{__proto__:null,value:i,writable:!0,enumerable:!0,configurable:!0})},{allOwnKeys:r}),e),ube=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),cbe=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),Object.defineProperty(e.prototype,"constructor",{__proto__:null,value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(e,"super",{__proto__:null,value:t.prototype}),n&&Object.assign(e.prototype,n)},fbe=(e,t,n,r)=>{let i,o,a;const s={};if(t=t||{},e==null)return t;do{for(i=Object.getOwnPropertyNames(e),o=i.length;o-- >0;)a=i[o],(!r||r(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=n!==!1&&hm(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},dbe=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},hbe=e=>{if(!e)return null;if(Tp(e))return e;let t=e.length;if(!rK(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},pbe=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&hm(Uint8Array)),vbe=(e,t)=>{const r=(e&&e[Y_]).call(e);let i;for(;(i=r.next())&&!i.done;){const o=i.value;t.call(e,o[0],o[1])}},gbe=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},mbe=Sl("HTMLFormElement"),ybe=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,i){return r.toUpperCase()+i}),{propertyIsEnumerable:bbe}=Object.prototype,_be=Sl("RegExp"),aK=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};j_(n,(i,o)=>{let a;(a=t(i,o,e))!==!1&&(r[o]=a||i)}),Object.defineProperties(e,r)},Sbe=e=>{aK(e,(t,n)=>{if(Aa(e)&&["arguments","caller","callee"].includes(n))return!1;const r=e[n];if(Aa(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},wbe=(e,t)=>{const n={},r=i=>{i.forEach(o=>{n[o]=!0})};return Tp(e)?r(e):r(String(e).split(t)),n},xbe=()=>{},Tbe=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function Ebe(e){return!!(e&&Aa(e.append)&&e[tK]==="FormData"&&e[Y_])}const Cbe=e=>{const t=new WeakSet,n=r=>{if(fy(r)){if(t.has(r))return;if(cy(r))return r;if(!("toJSON"in r)){t.add(r);const i=Tp(r)?[]:{};return j_(r,(o,a)=>{const s=n(o);!pm(s)&&(i[a]=s)}),t.delete(r),i}}return r};return n(e)},Ibe=Sl("AsyncFunction"),Abe=e=>e&&(fy(e)||Aa(e))&&Aa(e.then)&&Aa(e.catch),sK=((e,t)=>e?setImmediate:t?((n,r)=>(Hh.addEventListener("message",({source:i,data:o})=>{i===Hh&&o===n&&r.length&&r.shift()()},!1),i=>{r.push(i),Hh.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",Aa(Hh.postMessage)),Rbe=typeof queueMicrotask<"u"?queueMicrotask.bind(Hh):typeof process<"u"&&process.nextTick||sK,lK=e=>e!=null&&Aa(e[Y_]),kbe=e=>e!=null&&R1(e,Y_)&&lK(e),we={isArray:Tp,isArrayBuffer:nK,isBuffer:cy,isFormData:tbe,isArrayBufferView:H0e,isString:W0e,isNumber:rK,isBoolean:z0e,isObject:fy,isPlainObject:bT,isEmptyObject:Y0e,isReadableStream:rbe,isRequest:ibe,isResponse:obe,isHeaders:abe,isUndefined:pm,isDate:j0e,isFile:X0e,isReactNativeBlob:K0e,isReactNative:Z0e,isBlob:J0e,isRegExp:_be,isFunction:Aa,isStream:q0e,isURLSearchParams:nbe,isTypedArray:pbe,isFileList:Q0e,forEach:j_,merge:uO,extend:lbe,trim:sbe,stripBOM:ube,inherits:cbe,toFlatObject:fbe,kindOf:LM,kindOfTest:Sl,endsWith:dbe,toArray:hbe,forEachEntry:vbe,matchAll:gbe,isHTMLForm:mbe,hasOwnProperty:UE,hasOwnProp:UE,hasOwnInPrototypeChain:R1,getSafeProp:G0e,reduceDescriptors:aK,freezeMethods:Sbe,toObjectSet:wbe,toCamelCase:ybe,noop:xbe,toFiniteNumber:Tbe,findKey:iK,global:Hh,isContextDefined:oK,isSpecCompliantForm:Ebe,toJSONObject:Cbe,isAsyncFn:Ibe,isThenable:Abe,setImmediate:sK,asap:Rbe,isIterable:lK,isSafeIterable:kbe},Pbe=we.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Dbe=e=>{const t={};let n,r,i;return e&&e.split(` +`).forEach(function(a){i=a.indexOf(":"),n=a.substring(0,i).trim().toLowerCase(),r=a.substring(i+1).trim(),!(!n||t[n]&&Pbe[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t};function Obe(e){let t=0,n=e.length;for(;tt;){const r=e.charCodeAt(n-1);if(r!==9&&r!==32)break;n-=1}return t===0&&n===e.length?e:e.slice(t,n)}const Lbe=new RegExp("[\\u0000-\\u0008\\u000a-\\u001f\\u007f]+","g"),Nbe=new RegExp("[^\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+","g");function NM(e,t){return we.isArray(e)?e.map(n=>NM(n,t)):Obe(String(e).replace(t,""))}const Mbe=e=>NM(e,Lbe),Fbe=e=>NM(e,Nbe);function uK(e){const t=Object.create(null);return we.forEach(e.toJSON(),(n,r)=>{t[r]=Fbe(n)}),t}const gU=Symbol("internals");function o0(e){return e&&String(e).trim().toLowerCase()}function _T(e){return e===!1||e==null?e:we.isArray(e)?e.map(_T):Mbe(String(e))}function $be(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const Bbe=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function FR(e,t,n,r,i){if(we.isFunction(r))return r.call(this,t,n);if(i&&(t=n),!!we.isString(t)){if(we.isString(r))return t.indexOf(r)!==-1;if(we.isRegExp(r))return r.test(t)}}function Vbe(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function Ube(e,t){const n=we.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{__proto__:null,value:function(i,o,a){return this[r].call(this,t,i,o,a)},configurable:!0})})}let Co=class{constructor(t){t&&this.set(t)}set(t,n,r){const i=this;function o(s,l,u){const c=o0(l);if(!c)return;const f=we.findKey(i,c);(!f||i[f]===void 0||u===!0||u===void 0&&i[f]!==!1)&&(i[f||l]=_T(s))}const a=(s,l)=>we.forEach(s,(u,c)=>o(u,c,l));if(we.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(we.isString(t)&&(t=t.trim())&&!Bbe(t))a(Dbe(t),n);else if(we.isObject(t)&&we.isSafeIterable(t)){let s=Object.create(null),l,u;for(const c of t){if(!we.isArray(c))throw new TypeError("Object iterator must return a key-value pair");u=c[0],we.hasOwnProp(s,u)?(l=s[u],s[u]=we.isArray(l)?[...l,c[1]]:[l,c[1]]):s[u]=c[1]}a(s,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=o0(t),t){const r=we.findKey(this,t);if(r){const i=this[r];if(!n)return i;if(n===!0)return $be(i);if(we.isFunction(n))return n.call(this,i,r);if(we.isRegExp(n))return n.exec(i);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=o0(t),t){const r=we.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||FR(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let i=!1;function o(a){if(a=o0(a),a){const s=we.findKey(r,a);s&&(!n||FR(r,r[s],s,n))&&(delete r[s],i=!0)}}return we.isArray(t)?t.forEach(o):o(t),i}clear(t){const n=Object.keys(this);let r=n.length,i=!1;for(;r--;){const o=n[r];(!t||FR(this,this[o],o,t,!0))&&(delete this[o],i=!0)}return i}normalize(t){const n=this,r={};return we.forEach(this,(i,o)=>{const a=we.findKey(r,o);if(a){n[a]=_T(i),delete n[o];return}const s=t?Vbe(o):String(o).trim();s!==o&&delete n[o],n[s]=_T(i),r[s]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return we.forEach(this,(r,i)=>{r!=null&&r!==!1&&(n[i]=t&&we.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` +`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(i=>r.set(i)),r}static accessor(t){const r=(this[gU]=this[gU]={accessors:{}}).accessors,i=this.prototype;function o(a){const s=o0(a);r[s]||(Ube(i,a),r[s]=!0)}return we.isArray(t)?t.forEach(o):o(t),this}};Co.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);we.reduceDescriptors(Co.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});we.freezeMethods(Co);const Gbe="[REDACTED ****]";function Hbe(e){if(we.hasOwnProp(e,"toJSON"))return!0;let t=Object.getPrototypeOf(e);for(;t&&t!==Object.prototype;){if(we.hasOwnProp(t,"toJSON"))return!0;t=Object.getPrototypeOf(t)}return!1}function Wbe(e,t){const n=new Set(t.map(o=>String(o).toLowerCase())),r=[],i=o=>{if(o===null||typeof o!="object"||we.isBuffer(o))return o;if(r.indexOf(o)!==-1)return;o instanceof Co&&(o=o.toJSON()),r.push(o);let a;if(we.isArray(o))a=[],o.forEach((s,l)=>{const u=i(s);we.isUndefined(u)||(a[l]=u)});else{if(!we.isPlainObject(o)&&Hbe(o))return r.pop(),o;a=Object.create(null);for(const[s,l]of Object.entries(o)){const u=n.has(s.toLowerCase())?Gbe:i(l);we.isUndefined(u)||(a[s]=u)}}return r.pop(),a};return i(e)}let mt=class cK extends Error{static from(t,n,r,i,o,a){const s=new cK(t.message,n||t.code,r,i,o);return s.cause=t,s.name=t.name,t.status!=null&&s.status==null&&(s.status=t.status),a&&Object.assign(s,a),s}constructor(t,n,r,i,o){super(t),Object.defineProperty(this,"message",{__proto__:null,value:t,enumerable:!0,writable:!0,configurable:!0}),this.name="AxiosError",this.isAxiosError=!0,n&&(this.code=n),r&&(this.config=r),i&&(this.request=i),o&&(this.response=o,this.status=o.status)}toJSON(){const t=this.config,n=t&&we.hasOwnProp(t,"redact")?t.redact:void 0,r=we.isArray(n)&&n.length>0?Wbe(t,n):we.toJSONObject(t);return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:r,code:this.code,status:this.status}}};mt.ERR_BAD_OPTION_VALUE="ERR_BAD_OPTION_VALUE";mt.ERR_BAD_OPTION="ERR_BAD_OPTION";mt.ECONNABORTED="ECONNABORTED";mt.ETIMEDOUT="ETIMEDOUT";mt.ECONNREFUSED="ECONNREFUSED";mt.ERR_NETWORK="ERR_NETWORK";mt.ERR_FR_TOO_MANY_REDIRECTS="ERR_FR_TOO_MANY_REDIRECTS";mt.ERR_DEPRECATED="ERR_DEPRECATED";mt.ERR_BAD_RESPONSE="ERR_BAD_RESPONSE";mt.ERR_BAD_REQUEST="ERR_BAD_REQUEST";mt.ERR_CANCELED="ERR_CANCELED";mt.ERR_NOT_SUPPORT="ERR_NOT_SUPPORT";mt.ERR_INVALID_URL="ERR_INVALID_URL";mt.ERR_FORM_DATA_DEPTH_EXCEEDED="ERR_FORM_DATA_DEPTH_EXCEEDED";const zbe=null,fK=100;function cO(e){return we.isPlainObject(e)||we.isArray(e)}function dK(e){return we.endsWith(e,"[]")?e.slice(0,-2):e}function $R(e,t,n){return e?e.concat(t).map(function(i,o){return i=dK(i),!n&&o?"["+i+"]":i}).join(n?".":""):t}function Ybe(e){return we.isArray(e)&&!e.some(cO)}const jbe=we.toFlatObject(we,{},null,function(t){return/^is[A-Z]/.test(t)});function OI(e,t,n){if(!we.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=we.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,S){return!we.isUndefined(S[b])});const r=n.metaTokens,i=n.visitor||p,o=n.dots,a=n.indexes,s=n.Blob||typeof Blob<"u"&&Blob,l=n.maxDepth===void 0?fK:n.maxDepth,u=s&&we.isSpecCompliantForm(t),c=[];if(!we.isFunction(i))throw new TypeError("visitor must be a function");function f(m){if(m===null)return"";if(we.isDate(m))return m.toISOString();if(we.isBoolean(m))return m.toString();if(!u&&we.isBlob(m))throw new mt("Blob is not supported. Use a Buffer instead.");return we.isArrayBuffer(m)||we.isTypedArray(m)?u&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function h(m){if(m>l)throw new mt("Object is too deeply nested ("+m+" levels). Max depth: "+l,mt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function d(m,b){if(l===1/0)return JSON.stringify(m);const S=[];return JSON.stringify(m,function(x,T){if(!we.isObject(T))return T;for(;S.length&&S[S.length-1]!==this;)S.pop();return S.push(T),h(b+S.length-1),T})}function p(m,b,S){let w=m;if(we.isReactNative(t)&&we.isReactNativeBlob(m))return t.append($R(S,b,o),f(m)),!1;if(m&&!S&&typeof m=="object"){if(we.endsWith(b,"{}"))b=r?b:b.slice(0,-2),m=d(m,1);else if(we.isArray(m)&&Ybe(m)||(we.isFileList(m)||we.endsWith(b,"[]"))&&(w=we.toArray(m)))return b=dK(b),w.forEach(function(T,C){!(we.isUndefined(T)||T===null)&&t.append(a===!0?$R([b],C,o):a===null?b:b+"[]",f(T))}),!1}return cO(m)?!0:(t.append($R(S,b,o),f(m)),!1)}const v=Object.assign(jbe,{defaultVisitor:p,convertValue:f,isVisitable:cO});function y(m,b,S=0){if(!we.isUndefined(m)){if(h(S),c.indexOf(m)!==-1)throw new Error("Circular reference detected in "+b.join("."));c.push(m),we.forEach(m,function(x,T){(!(we.isUndefined(x)||x===null)&&i.call(t,x,we.isString(T)?T.trim():T,b,v))===!0&&y(x,b?b.concat(T):[T],S+1)}),c.pop()}}if(!we.isObject(e))throw new TypeError("data must be an object");return y(e),t}function mU(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"};return encodeURIComponent(e).replace(/[!'()~]|%20/g,function(r){return t[r]})}function MM(e,t){this._pairs=[],e&&OI(e,this,t)}const hK=MM.prototype;hK.append=function(t,n){this._pairs.push([t,n])};hK.toString=function(t){const n=t?function(r){return t.call(this,r,mU)}:mU;return this._pairs.map(function(i){return n(i[0])+"="+n(i[1])},"").join("&")};function Xbe(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function pK(e,t,n){if(!t)return e;const r=we.isFunction(n)?{serialize:n}:n,i=we.getSafeProp(r,"encode")||Xbe,o=we.getSafeProp(r,"serialize");let a;if(o?a=o(t,r):a=we.isURLSearchParams(t)?t.toString():new MM(t,r).toString(i),a){const s=e.indexOf("#");s!==-1&&(e=e.slice(0,s)),e+=(e.indexOf("?")===-1?"?":"&")+a}return e}class yU{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){we.forEach(this.handlers,function(r){r!==null&&t(r)})}}const FM={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1,legacyInterceptorReqResOrdering:!0,advertiseZstdAcceptEncoding:!1,validateStatusUndefinedResolves:!0},Kbe=typeof URLSearchParams<"u"?URLSearchParams:MM,Zbe=typeof FormData<"u"?FormData:null,Jbe=typeof Blob<"u"?Blob:null,Qbe={isBrowser:!0,classes:{URLSearchParams:Kbe,FormData:Zbe,Blob:Jbe},protocols:["http","https","file","blob","url","data"]},$M=typeof window<"u"&&typeof document<"u",fO=typeof navigator=="object"&&navigator||void 0,qbe=$M&&(!fO||["ReactNative","NativeScript","NS"].indexOf(fO.product)<0),e1e=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",t1e=$M&&window.location.href||"http://localhost",n1e=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:$M,hasStandardBrowserEnv:qbe,hasStandardBrowserWebWorkerEnv:e1e,navigator:fO,origin:t1e},Symbol.toStringTag,{value:"Module"})),qi={...n1e,...Qbe};function r1e(e,t){return OI(e,new qi.classes.URLSearchParams,{visitor:function(n,r,i,o){return qi.isNode&&we.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}const bU=fK;function vK(e){if(e>bU)throw new mt("FormData field is too deeply nested ("+e+" levels). Max depth: "+bU,mt.ERR_FORM_DATA_DEPTH_EXCEEDED)}function i1e(e){const t=[],n=/\w+|\[(\w*)]/g;let r;for(;(r=n.exec(e))!==null;)vK(t.length),t.push(r[0]==="[]"?"":r[1]||r[0]);return t}function o1e(e){const t={},n=Object.keys(e);let r;const i=n.length;let o;for(r=0;r=n.length;return a=!a&&we.isArray(i)?i.length:a,l?(we.hasOwnProp(i,a)?i[a]=we.isArray(i[a])?i[a].concat(r):[i[a],r]:i[a]=r,!s):((!we.hasOwnProp(i,a)||!we.isObject(i[a]))&&(i[a]=[]),t(n,r,i[a],o)&&we.isArray(i[a])&&(i[a]=o1e(i[a])),!s)}if(we.isFormData(e)&&we.isFunction(e.entries)){const n={};return we.forEachEntry(e,(r,i)=>{t(i1e(r),i,n,0)}),n}return null}const Cv=(e,t)=>e!=null&&we.hasOwnProp(e,t)?e[t]:void 0;function a1e(e,t,n){if(we.isString(e))try{return(t||JSON.parse)(e),we.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const X_={transitional:FM,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",i=r.indexOf("application/json")>-1,o=we.isObject(t);if(o&&we.isHTMLForm(t)&&(t=new FormData(t)),we.isFormData(t))return i?JSON.stringify(gK(t)):t;if(we.isArrayBuffer(t)||we.isBuffer(t)||we.isStream(t)||we.isFile(t)||we.isBlob(t)||we.isReadableStream(t))return t;if(we.isArrayBufferView(t))return t.buffer;if(we.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){const l=Cv(this,"formSerializer");if(r.indexOf("application/x-www-form-urlencoded")>-1)return r1e(t,l).toString();if((s=we.isFileList(t))||r.indexOf("multipart/form-data")>-1){const u=Cv(this,"env"),c=u&&u.FormData;return OI(s?{"files[]":t}:t,c&&new c,l)}}return o||i?(n.setContentType("application/json",!1),a1e(t)):t}],transformResponse:[function(t){const n=Cv(this,"transitional")||X_.transitional,r=n&&n.forcedJSONParsing,i=Cv(this,"responseType"),o=i==="json";if(we.isResponse(t)||we.isReadableStream(t))return t;if(t&&we.isString(t)&&(r&&!i||o)){const s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(t,Cv(this,"parseReviver"))}catch(l){if(s)throw l.name==="SyntaxError"?mt.from(l,mt.ERR_BAD_RESPONSE,this,null,Cv(this,"response")):l}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qi.classes.FormData,Blob:qi.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};we.forEach(["delete","get","head","post","put","patch","query"],e=>{X_.headers[e]={}});function BR(e,t){const n=this||X_,r=t||n,i=Co.from(r.headers);let o=r.data;return we.forEach(e,function(s){o=s.call(n,o,i.normalize(),t?t.status:void 0)}),i.normalize(),o}function mK(e){return!!(e&&e.__CANCEL__)}let K_=class extends mt{constructor(t,n,r){super(t??"canceled",mt.ERR_CANCELED,n,r),this.name="CanceledError",this.__CANCEL__=!0}};function yK(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new mt("Request failed with status code "+n.status,n.status>=400&&n.status<500?mt.ERR_BAD_REQUEST:mt.ERR_BAD_RESPONSE,n.config,n.request,n))}function s1e(e){const t=/^([-+\w]{1,25}):(?:\/\/)?/.exec(e);return t&&t[1]||""}function l1e(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i=0,o=0,a;return t=t!==void 0?t:1e3,function(l){const u=Date.now(),c=r[o];a||(a=u),n[i]=l,r[i]=u;let f=o,h=0;for(;f!==i;)h+=n[f++],f=f%e;if(i=(i+1)%e,i===o&&(o=(o+1)%e),u-a{n=c,i=null,o&&(clearTimeout(o),o=null),e(...u)};return[(...u)=>{const c=Date.now(),f=c-n;f>=r?a(u,c):(i=u,o||(o=setTimeout(()=>{o=null,a(i)},r-f)))},()=>i&&a(i)]}const GE=(e,t,n=3)=>{let r=0;const i=l1e(50,250);return u1e(o=>{if(!o||typeof o.loaded!="number")return;const a=o.loaded,s=o.lengthComputable?o.total:void 0,l=s!=null?Math.min(a,s):a,u=Math.max(0,l-r),c=i(u);r=Math.max(r,l);const f={loaded:l,total:s,progress:s?l/s:void 0,bytes:u,rate:c||void 0,estimated:c&&s?(s-l)/c:void 0,event:o,lengthComputable:s!=null,[t?"download":"upload"]:!0};e(f)},n)},_U=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},SU=e=>(...t)=>we.asap(()=>e(...t)),c1e=qi.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,qi.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(qi.origin),qi.navigator&&/(msie|trident)/i.test(qi.navigator.userAgent)):()=>!0,f1e=qi.hasStandardBrowserEnv?{write(e,t,n,r,i,o,a){if(typeof document>"u")return;const s=[`${e}=${encodeURIComponent(t)}`];we.isNumber(n)&&s.push(`expires=${new Date(n).toUTCString()}`),we.isString(r)&&s.push(`path=${r}`),we.isString(i)&&s.push(`domain=${i}`),o===!0&&s.push("secure"),we.isString(a)&&s.push(`SameSite=${a}`),document.cookie=s.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.split(";");for(let n=0;ne instanceof Co?{...e}:e;function Ep(e,t){t=t||{};const n=Object.create(null);Object.defineProperty(n,"hasOwnProperty",{__proto__:null,value:Object.prototype.hasOwnProperty,enumerable:!1,writable:!0,configurable:!0});function r(c,f,h,d){return we.isPlainObject(c)&&we.isPlainObject(f)?we.merge.call({caseless:d},c,f):we.isPlainObject(f)?we.merge({},f):we.isArray(f)?f.slice():f}function i(c,f,h,d){if(we.isUndefined(f)){if(!we.isUndefined(c))return r(void 0,c,h,d)}else return r(c,f,h,d)}function o(c,f){if(!we.isUndefined(f))return r(void 0,f)}function a(c,f){if(we.isUndefined(f)){if(!we.isUndefined(c))return r(void 0,c)}else return r(void 0,f)}function s(c){const f=we.hasOwnProp(t,"transitional")?t.transitional:void 0;if(!we.isUndefined(f))if(we.isPlainObject(f)){if(we.hasOwnProp(f,c))return f[c]}else return;const h=we.hasOwnProp(e,"transitional")?e.transitional:void 0;if(we.isPlainObject(h)&&we.hasOwnProp(h,c))return h[c]}function l(c,f,h){if(we.hasOwnProp(t,h))return r(c,f);if(we.hasOwnProp(e,h))return r(void 0,c)}const u={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,allowedSocketPaths:a,responseEncoding:a,validateStatus:l,headers:(c,f,h)=>i(xU(c),xU(f),h,!0)};return we.forEach(Object.keys({...e,...t}),function(f){if(f==="__proto__"||f==="constructor"||f==="prototype")return;const h=we.hasOwnProp(u,f)?u[f]:i,d=we.hasOwnProp(e,f)?e[f]:void 0,p=we.hasOwnProp(t,f)?t[f]:void 0,v=h(d,p,f);we.isUndefined(v)&&h!==l||(n[f]=v)}),we.hasOwnProp(t,"validateStatus")&&we.isUndefined(t.validateStatus)&&s("validateStatusUndefinedResolves")===!1&&(we.hasOwnProp(e,"validateStatus")?n.validateStatus=r(void 0,e.validateStatus):delete n.validateStatus),n}const y1e=["content-type","content-length"];function b1e(e,t,n){if(n!=="content-only"){e.set(t);return}Object.entries(t).forEach(([r,i])=>{y1e.includes(r.toLowerCase())&&e.set(r,i)})}const _1e=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16)));function _K(e){const t=Ep({},e),n=h=>we.hasOwnProp(t,h)?t[h]:void 0,r=n("data");let i=n("withXSRFToken");const o=n("xsrfHeaderName"),a=n("xsrfCookieName");let s=n("headers");const l=n("auth"),u=n("baseURL"),c=n("allowAbsoluteUrls"),f=n("url");if(t.headers=s=Co.from(s),t.url=pK(bK(u,f,c,t),n("params"),n("paramsSerializer")),l){const h=we.getSafeProp(l,"username")||"",d=we.getSafeProp(l,"password")||"";s.set("Authorization","Basic "+btoa(h+":"+(d?_1e(d):"")))}if(we.isFormData(r)&&(qi.hasStandardBrowserEnv||qi.hasStandardBrowserWebWorkerEnv||we.isReactNative(r)?s.setContentType(void 0):we.isFunction(r.getHeaders)&&b1e(s,r.getHeaders(),n("formDataHeaderPolicy"))),qi.hasStandardBrowserEnv&&(we.isFunction(i)&&(i=i(t)),i===!0||i==null&&c1e(t.url))){const d=o&&a&&f1e.read(a);d&&s.set(o,d)}return t}const S1e=typeof XMLHttpRequest<"u",w1e=S1e&&function(e){return new Promise(function(n,r){const i=_K(e);let o=i.data;const a=Co.from(i.headers).normalize();let{responseType:s,onUploadProgress:l,onDownloadProgress:u}=i,c,f,h,d,p;function v(){d&&d(),p&&p(),i.cancelToken&&i.cancelToken.unsubscribe(c),i.signal&&i.signal.removeEventListener("abort",c)}let y=new XMLHttpRequest;y.open(i.method.toUpperCase(),i.url,!0),y.timeout=i.timeout;function m(){if(!y)return;const S=Co.from("getAllResponseHeaders"in y&&y.getAllResponseHeaders()),x={data:!s||s==="text"||s==="json"?y.responseText:y.response,status:y.status,statusText:y.statusText,headers:S,config:e,request:y};yK(function(C){n(C),v()},function(C){r(C),v()},x),y=null}"onloadend"in y?y.onloadend=m:y.onreadystatechange=function(){!y||y.readyState!==4||y.status===0&&!(y.responseURL&&y.responseURL.startsWith("file:"))||setTimeout(m)},y.onabort=function(){y&&(r(new mt("Request aborted",mt.ECONNABORTED,e,y)),v(),y=null)},y.onerror=function(w){const x=w&&w.message?w.message:"Network Error",T=new mt(x,mt.ERR_NETWORK,e,y);T.event=w||null,r(T),v(),y=null},y.ontimeout=function(){let w=i.timeout?"timeout of "+i.timeout+"ms exceeded":"timeout exceeded";const x=i.transitional||FM;i.timeoutErrorMessage&&(w=i.timeoutErrorMessage),r(new mt(w,x.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,e,y)),v(),y=null},o===void 0&&a.setContentType(null),"setRequestHeader"in y&&we.forEach(uK(a),function(w,x){y.setRequestHeader(x,w)}),we.isUndefined(i.withCredentials)||(y.withCredentials=!!i.withCredentials),s&&s!=="json"&&(y.responseType=i.responseType),u&&([h,p]=GE(u,!0),y.addEventListener("progress",h)),l&&y.upload&&([f,d]=GE(l),y.upload.addEventListener("progress",f),y.upload.addEventListener("loadend",d)),(i.cancelToken||i.signal)&&(c=S=>{y&&(r(!S||S.type?new K_(null,e,y):S),y.abort(),v(),y=null)},i.cancelToken&&i.cancelToken.subscribe(c),i.signal&&(i.signal.aborted?c():i.signal.addEventListener("abort",c)));const b=s1e(i.url);if(b&&!qi.protocols.includes(b)){r(new mt("Unsupported protocol "+b+":",mt.ERR_BAD_REQUEST,e));return}y.send(o||null)})},x1e=(e,t)=>{if(e=e?e.filter(Boolean):[],!t&&!e.length)return;const n=new AbortController;let r=!1;const i=function(l){if(!r){r=!0,a();const u=l instanceof Error?l:this.reason;n.abort(u instanceof mt?u:new K_(u instanceof Error?u.message:u))}};let o=t&&setTimeout(()=>{o=null,i(new mt(`timeout of ${t}ms exceeded`,mt.ETIMEDOUT))},t);const a=()=>{e&&(o&&clearTimeout(o),o=null,e.forEach(l=>{l.unsubscribe?l.unsubscribe(i):l.removeEventListener("abort",i)}),e=null)};e.forEach(l=>l.addEventListener("abort",i));const{signal:s}=n;return s.unsubscribe=()=>we.asap(a),s},T1e=function*(e,t){let n=e.byteLength;if(n{const i=E1e(e,t);let o=0,a,s=l=>{a||(a=!0,r&&r(l))};return new ReadableStream({async pull(l){try{const{done:u,value:c}=await i.next();if(u){s(),l.close();return}let f=c.byteLength;if(n){let h=o+=f;n(h)}l.enqueue(new Uint8Array(c))}catch(u){throw s(u),u}},cancel(l){return s(l),i.return()}},{highWaterMark:2})},HE=e=>e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102,I1e=(e,t,n)=>t+2d>=2&&r.charCodeAt(d-2)===37&&r.charCodeAt(d-1)===51&&(r.charCodeAt(d)===68||r.charCodeAt(d)===100);u>=0&&(r.charCodeAt(u)===61?(l++,u--):c(u)&&(l++,u-=3)),l===1&&u>=0&&(r.charCodeAt(u)===61||c(u))&&l++;const h=Math.floor(a/4)*3-(l||0);return h>0?h:0}let o=0;for(let a=0,s=r.length;a=55296&&l<=56319&&a+1=56320&&u<=57343?(o+=4,a++):o+=3}else o+=3}return o}const BM="1.18.0",EU=64*1024,{isFunction:Pw}=we,R1e=e=>encodeURIComponent(e).replace(/%([0-9A-F]{2})/gi,(t,n)=>String.fromCharCode(parseInt(n,16))),CU=e=>{if(!we.isString(e))return e;try{return decodeURIComponent(e)}catch{return e}},IU=(e,...t)=>{try{return!!e(...t)}catch{return!1}},k1e=e=>{const t=e.indexOf("://");let n=e;return t!==-1&&(n=n.slice(t+3)),n.includes("@")||n.includes(":")},P1e=e=>{const t=we.global!==void 0&&we.global!==null?we.global:globalThis,{ReadableStream:n,TextEncoder:r}=t;e=we.merge.call({skipUndefined:!0},{Request:t.Request,Response:t.Response},e);const{fetch:i,Request:o,Response:a}=e,s=i?Pw(i):typeof fetch=="function",l=Pw(o),u=Pw(a);if(!s)return!1;const c=s&&Pw(n),f=s&&(typeof r=="function"?(m=>b=>m.encode(b))(new r):async m=>new Uint8Array(await new o(m).arrayBuffer())),h=l&&c&&IU(()=>{let m=!1;const b=new o(qi.origin,{body:new n,method:"POST",get duplex(){return m=!0,"half"}}),S=b.headers.has("Content-Type");return b.body!=null&&b.body.cancel(),m&&!S}),d=u&&c&&IU(()=>we.isReadableStream(new a("").body)),p={stream:d&&(m=>m.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!p[m]&&(p[m]=(b,S)=>{let w=b&&b[m];if(w)return w.call(b);throw new mt(`Response type '${m}' is not supported`,mt.ERR_NOT_SUPPORT,S)})});const v=async m=>{if(m==null)return 0;if(we.isBlob(m))return m.size;if(we.isSpecCompliantForm(m))return(await new o(qi.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(we.isArrayBufferView(m)||we.isArrayBuffer(m))return m.byteLength;if(we.isURLSearchParams(m)&&(m=m+""),we.isString(m))return(await f(m)).byteLength},y=async(m,b)=>{const S=we.toFiniteNumber(m.getContentLength());return S??v(b)};return async m=>{let{url:b,method:S,data:w,signal:x,cancelToken:T,timeout:C,onDownloadProgress:P,onUploadProgress:k,responseType:L,headers:O,withCredentials:M="same-origin",fetchOptions:F,maxContentLength:U,maxBodyLength:X}=_K(m);const $=we.isNumber(U)&&U>-1,W=we.isNumber(X)&&X>-1,G=be=>we.hasOwnProp(m,be)?m[be]:void 0;let Q=i||fetch;L=L?(L+"").toLowerCase():"text";let ne=x1e([x,T&&T.toAbortSignal()],C),re=null;const pe=ne&&ne.unsubscribe&&(()=>{ne.unsubscribe()});let ke,Re=null;const Me=()=>new mt("Request body larger than maxBodyLength limit",mt.ERR_BAD_REQUEST,m,re);try{let be;const fe=G("auth");if(fe){const Te=we.getSafeProp(fe,"username")||"",Oe=we.getSafeProp(fe,"password")||"";be={username:Te,password:Oe}}if(k1e(b)){const Te=new URL(b,qi.origin);if(!be&&(Te.username||Te.password)){const Oe=CU(Te.username),Z=CU(Te.password);be={username:Oe,password:Z}}(Te.username||Te.password)&&(Te.username="",Te.password="",b=Te.href)}if(be&&(O.delete("authorization"),O.set("Authorization","Basic "+btoa(R1e((be.username||"")+":"+(be.password||""))))),$&&typeof b=="string"&&b.startsWith("data:")&&A1e(b)>U)throw new mt("maxContentLength size of "+U+" exceeded",mt.ERR_BAD_RESPONSE,m,re);if(W&&S!=="get"&&S!=="head"){const Te=await v(w);if(typeof Te=="number"&&isFinite(Te)&&(ke=Te,Te>X))throw Me()}const Le=W&&(we.isReadableStream(w)||we.isStream(w)),Ce=(Te,Oe,Z)=>TU(Te,EU,oe=>{if(W&&oe>X)throw Re=Me();Oe&&Oe(oe)},Z);if(h&&S!=="get"&&S!=="head"&&(k||Le)){if(ke=ke??await y(O,w),ke!==0||Le){let Te=new o(b,{method:"POST",body:w,duplex:"half"}),Oe;if(we.isFormData(w)&&(Oe=Te.headers.get("content-type"))&&O.setContentType(Oe),Te.body){const[Z,oe]=k&&_U(ke,GE(SU(k)))||[];w=Ce(Te.body,Z,oe)}}}else if(Le&&!l&&c&&S!=="get"&&S!=="head")w=Ce(w);else if(Le&&l&&!h&&S!=="get"&&S!=="head")throw new mt("Stream request bodies are not supported by the current fetch implementation",mt.ERR_NOT_SUPPORT,m,re);we.isString(M)||(M=M?"include":"omit");const Ue=l&&"credentials"in o.prototype;if(we.isFormData(w)){const Te=O.getContentType();Te&&/^multipart\/form-data/i.test(Te)&&!/boundary=/i.test(Te)&&O.delete("content-type")}O.set("User-Agent","axios/"+BM,!1);const Be={...F,signal:ne,method:S.toUpperCase(),headers:uK(O.normalize()),body:w,duplex:"half",credentials:Ue?M:void 0};re=l&&new o(b,Be);let Xe=await(l?Q(re,F):Q(b,Be));const J=Co.from(Xe.headers);if($){const Te=we.toFiniteNumber(J.getContentLength());if(Te!=null&&Te>U)throw new mt("maxContentLength size of "+U+" exceeded",mt.ERR_BAD_RESPONSE,m,re)}const ie=d&&(L==="stream"||L==="response");if(d&&Xe.body&&(P||$||ie&&pe)){const Te={};["status","statusText","headers"].forEach(Pe=>{Te[Pe]=Xe[Pe]});const Oe=we.toFiniteNumber(J.getContentLength()),[Z,oe]=P&&_U(Oe,GE(SU(P),!0))||[];let ve=0;const xe=Pe=>{if($&&(ve=Pe,ve>U))throw new mt("maxContentLength size of "+U+" exceeded",mt.ERR_BAD_RESPONSE,m,re);Z&&Z(Pe)};Xe=new a(TU(Xe.body,EU,xe,()=>{oe&&oe(),pe&&pe()}),Te)}L=L||"text";let ge=await p[we.findKey(p,L)||"text"](Xe,m);if($&&!d&&!ie){let Te;if(ge!=null&&(typeof ge.byteLength=="number"?Te=ge.byteLength:typeof ge.size=="number"?Te=ge.size:typeof ge=="string"&&(Te=typeof r=="function"?new r().encode(ge).byteLength:ge.length)),typeof Te=="number"&&Te>U)throw new mt("maxContentLength size of "+U+" exceeded",mt.ERR_BAD_RESPONSE,m,re)}return!ie&&pe&&pe(),await new Promise((Te,Oe)=>{yK(Te,Oe,{data:ge,headers:Co.from(Xe.headers),status:Xe.status,statusText:Xe.statusText,config:m,request:re})})}catch(be){if(pe&&pe(),ne&&ne.aborted&&ne.reason instanceof mt){const fe=ne.reason;throw fe.config=m,re&&(fe.request=re),be!==fe&&(fe.cause=be),fe}throw Re?(re&&!Re.request&&(Re.request=re),Re):be instanceof mt?(re&&!be.request&&(be.request=re),be):be&&be.name==="TypeError"&&/Load failed|fetch/i.test(be.message)?Object.assign(new mt("Network Error",mt.ERR_NETWORK,m,re,be&&be.response),{cause:be.cause||be}):mt.from(be,be&&be.code,m,re,be&&be.response)}}},D1e=new Map,SK=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:i}=t,o=[r,i,n];let a=o.length,s=a,l,u,c=D1e;for(;s--;)l=o[s],u=c.get(l),u===void 0&&c.set(l,u=s?new Map:P1e(t)),c=u;return u};SK();const VM={http:zbe,xhr:w1e,fetch:{get:SK}};we.forEach(VM,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{__proto__:null,value:t})}catch{}Object.defineProperty(e,"adapterName",{__proto__:null,value:t})}});const AU=e=>`- ${e}`,O1e=e=>we.isFunction(e)||e===null||e===!1;function L1e(e,t){e=we.isArray(e)?e:[e];const{length:n}=e;let r,i;const o={};for(let a=0;a`adapter ${l} `+(u===!1?"is not supported by the environment":"is not available in the build"));let s=n?a.length>1?`since : +`+a.map(AU).join(` +`):" "+AU(a[0]):"as no adapter specified";throw new mt("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return i}const wK={getAdapter:L1e,adapters:VM};function VR(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new K_(null,e)}function RU(e){return VR(e),e.headers=Co.from(e.headers),e.data=BR.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),wK.getAdapter(e.adapter||X_.adapter,e)(e).then(function(r){VR(e),e.response=r;try{r.data=BR.call(e,e.transformResponse,r)}finally{delete e.response}return r.headers=Co.from(r.headers),r},function(r){if(!mK(r)&&(VR(e),r&&r.response)){e.response=r.response;try{r.response.data=BR.call(e,e.transformResponse,r.response)}finally{delete e.response}r.response.headers=Co.from(r.response.headers)}return Promise.reject(r)})}const LI={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{LI[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const kU={};LI.transitional=function(t,n,r){function i(o,a){return"[Axios v"+BM+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,s)=>{if(t===!1)throw new mt(i(a," has been removed"+(n?" in "+n:"")),mt.ERR_DEPRECATED);return n&&!kU[a]&&(kU[a]=!0,console.warn(i(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,s):!0}};LI.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function N1e(e,t,n){if(typeof e!="object")throw new mt("options must be an object",mt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const o=r[i],a=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;if(a){const s=e[o],l=s===void 0||a(s,o,e);if(l!==!0)throw new mt("option "+o+" must be "+l,mt.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new mt("Unknown option "+o,mt.ERR_BAD_OPTION)}}const ST={assertOptions:N1e,validators:LI},lo=ST.validators;let up=class{constructor(t){this.defaults=t||{},this.interceptors={request:new yU,response:new yU}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let i={};Error.captureStackTrace?Error.captureStackTrace(i):i=new Error;const o=(()=>{if(!i.stack)return"";const a=i.stack.indexOf(` +`);return a===-1?"":i.stack.slice(a+1)})();try{if(!r.stack)r.stack=o;else if(o){const a=o.indexOf(` +`),s=a===-1?-1:o.indexOf(` +`,a+1),l=s===-1?"":o.slice(s+1);String(r.stack).endsWith(l)||(r.stack+=` +`+o)}}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ep(this.defaults,n);const{transitional:r,paramsSerializer:i,headers:o}=n;r!==void 0&&ST.assertOptions(r,{silentJSONParsing:lo.transitional(lo.boolean),forcedJSONParsing:lo.transitional(lo.boolean),clarifyTimeoutError:lo.transitional(lo.boolean),legacyInterceptorReqResOrdering:lo.transitional(lo.boolean),advertiseZstdAcceptEncoding:lo.transitional(lo.boolean),validateStatusUndefinedResolves:lo.transitional(lo.boolean)},!1),i!=null&&(we.isFunction(i)?n.paramsSerializer={serialize:i}:ST.assertOptions(i,{encode:lo.function,serialize:lo.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),ST.assertOptions(n,{baseUrl:lo.spelling("baseURL"),withXsrfToken:lo.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&we.merge(o.common,o[n.method]);o&&we.forEach(["delete","get","head","post","put","patch","query","common"],p=>{delete o[p]}),n.headers=Co.concat(a,o);const s=[];let l=!0;this.interceptors.request.forEach(function(v){if(typeof v.runWhen=="function"&&v.runWhen(n)===!1)return;l=l&&v.synchronous;const y=n.transitional||FM;y&&y.legacyInterceptorReqResOrdering?s.unshift(v.fulfilled,v.rejected):s.push(v.fulfilled,v.rejected)});const u=[];this.interceptors.response.forEach(function(v){u.push(v.fulfilled,v.rejected)});let c,f=0,h;if(!l){const p=[RU.bind(this),void 0];for(p.unshift(...s),p.push(...u),h=p.length,c=Promise.resolve(n);f{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](i);r._listeners=null}),this.promise.then=i=>{let o;const a=new Promise(s=>{r.subscribe(s),o=s}).then(i);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,s){r.reason||(r.reason=new K_(o,a,s),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new xK(function(i){t=i}),cancel:t}}};function F1e(e){return function(n){return e.apply(null,n)}}function $1e(e){return we.isObject(e)&&e.isAxiosError===!0}const dO={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(dO).forEach(([e,t])=>{dO[t]=e});function TK(e){const t=new up(e),n=eK(up.prototype.request,t);return we.extend(n,up.prototype,t,{allOwnKeys:!0}),we.extend(n,t,null,{allOwnKeys:!0}),n.create=function(i){return TK(Ep(e,i))},n}const Dt=TK(X_);Dt.Axios=up;Dt.CanceledError=K_;Dt.CancelToken=M1e;Dt.isCancel=mK;Dt.VERSION=BM;Dt.toFormData=OI;Dt.AxiosError=mt;Dt.Cancel=Dt.CanceledError;Dt.all=function(t){return Promise.all(t)};Dt.spread=F1e;Dt.isAxiosError=$1e;Dt.mergeConfig=Ep;Dt.AxiosHeaders=Co;Dt.formToJSON=e=>gK(we.isHTMLForm(e)?new FormData(e):e);Dt.getAdapter=wK.getAdapter;Dt.HttpStatusCode=dO;Dt.default=Dt;const{Axios:qqe,AxiosError:eet,CanceledError:tet,isCancel:net,CancelToken:ret,VERSION:iet,all:oet,Cancel:aet,isAxiosError:set,spread:uet,toFormData:cet,AxiosHeaders:fet,HttpStatusCode:det,formToJSON:het,getAdapter:pet,mergeConfig:vet,create:get}=Dt;Dt.interceptors.request.use(e=>(Sn.value&&(e.baseURL=SM(Sn.value),e.headers.Authorization="Bearer "+Sn.value.password),e));const B1e=["/delay","/healthcheck","/weights","/storage/zashboard"];Dt.interceptors.response.use(null,async e=>{if(e.status===401&&Ii.value){const{default:t}=await es(async()=>{const{default:r}=await Promise.resolve().then(()=>Yqe);return{default:r}},void 0,import.meta.url),n=Ii.value;Ii.value=null,t.push({name:un.setup,query:{editBackend:n}}),Tr(()=>{tr({content:"unauthorizedTip"})})}else if(!B1e.some(t=>e.config?.url?.endsWith(t))){const t=e.response?.data?.message||e.message;return tr({key:t,content:`${decodeURIComponent(e.config?.url||"")} +${t}`,type:"alert-error"}),Promise.reject(e)}return e});var wT={exports:{}},V1e=wT.exports,PU;function U1e(){return PU||(PU=1,(function(e,t){(function(n,r){e.exports=r(II())})(V1e,(function(n){function r(p){return p&&typeof p=="object"&&"default"in p?p:{default:p}}var i=r(n),o="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),a="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),s="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),l="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),u=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function c(p,v,y){var m,b;return y==="m"?v?"минута":"минуту":p+" "+(m=+p,b={mm:v?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[y].split("_"),m%10==1&&m%100!=11?b[0]:m%10>=2&&m%10<=4&&(m%100<10||m%100>=20)?b[1]:b[2])}var f=function(p,v){return u.test(v)?o[p.month()]:a[p.month()]};f.s=a,f.f=o;var h=function(p,v){return u.test(v)?s[p.month()]:l[p.month()]};h.s=l,h.f=s;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:f,monthsShort:h,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:c,mm:c,h:"час",hh:c,d:"день",dd:c,M:"месяц",MM:c,y:"год",yy:c},ordinal:function(p){return p},meridiem:function(p){return p<4?"ночи":p<12?"утра":p<17?"дня":"вечера"}};return i.default.locale(d,null,!0),d}))})(wT)),wT.exports}U1e();var xT={exports:{}},G1e=xT.exports,DU;function H1e(){return DU||(DU=1,(function(e,t){(function(n,r){e.exports=r(II())})(G1e,(function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var i=r(n),o={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,s){return s==="W"?a+"周":a+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(a,s){var l=100*a+s;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o}))})(xT)),xT.exports}H1e();var TT={exports:{}},W1e=TT.exports,OU;function z1e(){return OU||(OU=1,(function(e,t){(function(n,r){e.exports=r(II())})(W1e,(function(n){function r(a){return a&&typeof a=="object"&&"default"in a?a:{default:a}}var i=r(n),o={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(a,s){return s==="W"?a+"週":a+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(a,s){var l=100*a+s;return l<600?"凌晨":l<900?"早上":l<1100?"上午":l<1300?"中午":l<1800?"下午":"晚上"}};return i.default.locale(o,null,!0),o}))})(TT)),TT.exports}z1e();var ET={exports:{}},Y1e=ET.exports,LU;function j1e(){return LU||(LU=1,(function(e,t){(function(n,r){e.exports=r()})(Y1e,(function(){return function(n,r,i){n=n||{};var o=r.prototype,a={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function s(u,c,f,h){return o.fromToBase(u,c,f,h)}i.en.relativeTime=a,o.fromToBase=function(u,c,f,h,d){for(var p,v,y,m=f.$locale().relativeTime||a,b=n.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],S=b.length,w=0;w0,T<=x.r||!x.r){T<=1&&w>0&&(x=b[w-1]);var C=m[x.l];d&&(T=d(""+T)),v=typeof C=="string"?C.replace("%d",T):C(T,c,x.l,y);break}}if(c)return v;var P=y?m.future:m.past;return typeof P=="function"?P(v):P.replace("%s",v)},o.to=function(u,c){return s(u,c,this,!0)},o.from=function(u,c){return s(u,c,this)};var l=function(u){return u.$u?i.utc():i()};o.toNow=function(u){return this.to(l(this),u)},o.fromNow=function(u){return this.from(l(this),u)}}}))})(ET)),ET.exports}var X1e=j1e();const K1e=ly(X1e);var CT={exports:{}},Z1e=CT.exports,NU;function J1e(){return NU||(NU=1,(function(e,t){(function(n,r){e.exports=r()})(Z1e,(function(){function n(){return n=Object.assign||function(r){for(var i=1;iru.value,()=>{Br.locale(ru.value)},{immediate:!0});const ig=typeof document<"u";function EK(e){return typeof e=="object"||"displayName"in e||"props"in e||"__vccOpts"in e}function e_e(e){return e.__esModule||e[Symbol.toStringTag]==="Module"||e.default&&EK(e.default)}const Kn=Object.assign;function UR(e,t){const n={};for(const r in t){const i=t[r];n[r]=gl(i)?i.map(e):e(i)}return n}const Pb=()=>{},gl=Array.isArray;function MU(e,t){const n={};for(const r in e)n[r]=r in t?t[r]:e[r];return n}const CK=Symbol("");function vm(e,t){return Kn(new Error,{type:e,[CK]:!0},t)}function Wu(e,t){return e instanceof Error&&CK in e&&(t==null||!!(e.type&t))}const t_e=Symbol(""),FU=Symbol(""),NI=Symbol(""),UM=Symbol(""),hO=Symbol("");function Z_(){return Zo(NI)}function GM(e){return Zo(UM)}const IK=/#/g,n_e=/&/g,r_e=/\//g,i_e=/=/g,o_e=/\?/g,AK=/\+/g,a_e=/%5B/g,s_e=/%5D/g,RK=/%5E/g,l_e=/%60/g,kK=/%7B/g,u_e=/%7C/g,PK=/%7D/g,c_e=/%20/g;function HM(e){return e==null?"":encodeURI(""+e).replace(u_e,"|").replace(a_e,"[").replace(s_e,"]")}function f_e(e){return HM(e).replace(kK,"{").replace(PK,"}").replace(RK,"^")}function pO(e){return HM(e).replace(AK,"%2B").replace(c_e,"+").replace(IK,"%23").replace(n_e,"%26").replace(l_e,"`").replace(kK,"{").replace(PK,"}").replace(RK,"^")}function d_e(e){return pO(e).replace(i_e,"%3D")}function h_e(e){return HM(e).replace(IK,"%23").replace(o_e,"%3F")}function p_e(e){return h_e(e).replace(r_e,"%2F")}function WE(e){if(e==null)return null;try{return decodeURIComponent(""+e)}catch{}return""+e}const v_e=/\/$/,g_e=e=>e.replace(v_e,"");function GR(e,t,n="/"){let r,i={},o="",a="";const s=t.indexOf("#");let l=t.indexOf("?");return l=s>=0&&l>s?-1:l,l>=0&&(r=t.slice(0,l),o=t.slice(l,s>0?s:t.length),i=e(o.slice(1))),s>=0&&(r=r||t.slice(0,s),a=t.slice(s,t.length)),r=__e(r??t,n),{fullPath:r+o+a,path:r,query:i,hash:WE(a)}}function m_e(e,t){const n=t.query?e(t.query):"";return t.path+(n&&"?")+n+(t.hash||"")}function $U(e,t){return!t||!e.toLowerCase().startsWith(t.toLowerCase())?e:e.slice(t.length)||"/"}function y_e(e,t,n){const r=t.matched.length-1,i=n.matched.length-1;return r>-1&&r===i&&gm(t.matched[r],n.matched[i])&&DK(t.params,n.params)&&e(t.query)===e(n.query)&&t.hash===n.hash}function gm(e,t){return(e.aliasOf||e)===(t.aliasOf||t)}function DK(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var n in e)if(!b_e(e[n],t[n]))return!1;return!0}function b_e(e,t){return gl(e)?BU(e,t):gl(t)?BU(t,e):(e&&e.valueOf())===(t&&t.valueOf())}function BU(e,t){return gl(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e.length===1&&e[0]===t}function __e(e,t){if(e.startsWith("/"))return e;if(!e)return t;const n=t.split("/"),r=e.split("/"),i=r[r.length-1];(i===".."||i===".")&&r.push("");let o=n.length-1,a,s;for(a=0;a1&&o--;else break;return n.slice(0,o).join("/")+"/"+r.slice(a).join("/")}const uf={path:"/",name:void 0,params:{},query:{},hash:"",fullPath:"/",matched:[],meta:{},redirectedFrom:void 0};function S_e(e){if(!e)if(ig){const t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^\w+:\/\/[^/]+/,"")}else e="/";return e[0]!=="/"&&e[0]!=="#"&&(e="/"+e),g_e(e)}const w_e=/^[^#]+#/;function x_e(e,t){return e.replace(w_e,"#")+t}function T_e(e,t){const n=document.documentElement.getBoundingClientRect(),r=e.getBoundingClientRect();return{behavior:t.behavior,left:r.left-n.left-(t.left||0),top:r.top-n.top-(t.top||0)}}const MI=()=>({left:window.scrollX,top:window.scrollY});function E_e(e){let t;if("el"in e){const n=e.el,r=typeof n=="string"&&n.startsWith("#"),i=typeof n=="string"?r?document.getElementById(n.slice(1)):document.querySelector(n):n;if(!i)return;t=T_e(i,e)}else t=e;"scrollBehavior"in document.documentElement.style?window.scrollTo(t):window.scrollTo(t.left!=null?t.left:window.scrollX,t.top!=null?t.top:window.scrollY)}function VU(e,t){return(history.state?history.state.position-t:-1)+e}const vO=new Map;function C_e(e,t){vO.set(e,t)}function I_e(e){const t=vO.get(e);return vO.delete(e),t}function A_e(e){return typeof e=="string"||e&&typeof e=="object"}function OK(e){return typeof e=="string"||typeof e=="symbol"}function R_e(e){const t={};if(e===""||e==="?")return t;const n=(e[0]==="?"?e.slice(1):e).split("&");for(let r=0;ri&&pO(i)):[r&&pO(r)]).forEach(i=>{i!==void 0&&(t+=(t.length?"&":"")+n,i!=null&&(t+="="+i))})}return t}function k_e(e){const t={};for(const n in e){const r=e[n];r!==void 0&&(t[n]=gl(r)?r.map(i=>i==null?null:""+i):r==null?r:""+r)}return t}function a0(){let e=[];function t(r){return e.push(r),()=>{const i=e.indexOf(r);i>-1&&e.splice(i,1)}}function n(){e=[]}return{add:t,list:()=>e.slice(),reset:n}}function Df(e,t,n,r,i,o=a=>a()){const a=r&&(r.enterCallbacks[i]=r.enterCallbacks[i]||[]);return()=>new Promise((s,l)=>{const u=h=>{h===!1?l(vm(4,{from:n,to:t})):h instanceof Error?l(h):A_e(h)?l(vm(2,{from:t,to:h})):(a&&r.enterCallbacks[i]===a&&typeof h=="function"&&a.push(h),s())},c=o(()=>e.call(r&&r.instances[i],t,n,u));let f=Promise.resolve(c);e.length<3&&(f=f.then(u)),f.catch(h=>l(h))})}function HR(e,t,n,r,i=o=>o()){const o=[];for(const a of e)for(const s in a.components){let l=a.components[s];if(!(t!=="beforeRouteEnter"&&!a.instances[s]))if(EK(l)){const u=(l.__vccOpts||l)[t];u&&o.push(Df(u,n,r,a,s,i))}else{let u=l();o.push(()=>u.then(c=>{if(!c)throw new Error(`Couldn't resolve component "${s}" at "${a.path}"`);const f=e_e(c)?c.default:c;a.mods[s]=c,a.components[s]=f;const h=(f.__vccOpts||f)[t];return h&&Df(h,n,r,a,s,i)()}))}}return o}function P_e(e,t){const n=[],r=[],i=[],o=Math.max(t.matched.length,e.matched.length);for(let a=0;agm(u,s))?r.push(s):n.push(s));const l=e.matched[a];l&&(t.matched.find(u=>gm(u,l))||i.push(l))}return[n,r,i]}let D_e=()=>location.protocol+"//"+location.host;function LK(e,t){const{pathname:n,search:r,hash:i}=t,o=e.indexOf("#");if(o>-1){let a=i.includes(e.slice(o))?e.slice(o).length:1,s=i.slice(a);return s[0]!=="/"&&(s="/"+s),$U(s,"")}return $U(n,e)+r+i}function O_e(e,t,n,r){let i=[],o=[],a=null;const s=({state:h})=>{const d=LK(e,location),p=n.value,v=t.value;let y=0;if(h){if(n.value=d,t.value=h,a&&a===p){a=null;return}y=v?h.position-v.position:0}else r(d);i.forEach(m=>{m(n.value,p,{delta:y,type:"pop",direction:y?y>0?"forward":"back":""})})};function l(){a=n.value}function u(h){i.push(h);const d=()=>{const p=i.indexOf(h);p>-1&&i.splice(p,1)};return o.push(d),d}function c(){if(document.visibilityState==="hidden"){const{history:h}=window;if(!h.state)return;h.replaceState(Kn({},h.state,{scroll:MI()}),"")}}function f(){for(const h of o)h();o=[],window.removeEventListener("popstate",s),window.removeEventListener("pagehide",c),document.removeEventListener("visibilitychange",c)}return window.addEventListener("popstate",s),window.addEventListener("pagehide",c),document.addEventListener("visibilitychange",c),{pauseListeners:l,listen:u,destroy:f}}function GU(e,t,n,r=!1,i=!1){return{back:e,current:t,forward:n,replaced:r,position:window.history.length,scroll:i?MI():null}}function L_e(e){const{history:t,location:n}=window,r={value:LK(e,n)},i={value:t.state};i.value||o(r.value,{back:null,current:r.value,forward:null,position:t.length-1,replaced:!0,scroll:null},!0);function o(l,u,c){const f=e.indexOf("#"),h=f>-1?(n.host&&document.querySelector("base")?e:e.slice(f))+l:D_e()+e+l;try{t[c?"replaceState":"pushState"](u,"",h),i.value=u}catch(d){console.error(d),n[c?"replace":"assign"](h)}}function a(l,u){o(l,Kn({},t.state,GU(i.value.back,l,i.value.forward,!0),u,{position:i.value.position}),!0),r.value=l}function s(l,u){const c=Kn({},i.value,t.state,{forward:l,scroll:MI()});o(c.current,c,!0),o(l,Kn({},GU(r.value,l,null),{position:c.position+1},u),!1),r.value=l}return{location:r,state:i,push:s,replace:a}}function N_e(e){e=S_e(e);const t=L_e(e),n=O_e(e,t.state,t.location,t.replace);function r(o,a=!0){a||n.pauseListeners(),history.go(o)}const i=Kn({location:"",base:e,go:r,createHref:x_e.bind(null,e)},t,n);return Object.defineProperty(i,"location",{enumerable:!0,get:()=>t.location.value}),Object.defineProperty(i,"state",{enumerable:!0,get:()=>t.state.value}),i}function M_e(e){return e=location.host?e||location.pathname+location.search:"",e.includes("#")||(e+="#"),N_e(e)}const F_e={type:0,value:""},$_e=/[a-zA-Z0-9_]/;function B_e(e){if(!e)return[[]];if(e==="/")return[[F_e]];if(!e.startsWith("/"))throw new Error(`Invalid path "${e}"`);function t(d){throw new Error(`ERR (${n})/"${u}": ${d}`)}let n=0,r=n;const i=[];let o;function a(){o&&i.push(o),o=[]}let s=0,l,u="",c="";function f(){u&&(n===0?o.push({type:0,value:u}):n===1||n===2||n===3?(o.length>1&&(l==="*"||l==="+")&&t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`),o.push({type:1,value:u,regexp:c,repeatable:l==="*"||l==="+",optional:l==="*"||l==="?"})):t("Invalid state to consume buffer"),u="")}function h(){u+=l}for(;st.length?t.length===1&&t[0]===80?1:-1:0}function NK(e,t){let n=0;const r=e.score,i=t.score;for(;n0&&t[t.length-1]<0}const W_e={strict:!1,end:!0,sensitive:!1};function z_e(e,t,n){const r=G_e(B_e(e.path),n),i=Kn(r,{record:e,parent:t,children:[],alias:[]});return t&&!i.record.aliasOf==!t.record.aliasOf&&t.children.push(i),i}function Y_e(e,t){const n=[],r=new Map;t=MU(W_e,t);function i(f){return r.get(f)}function o(f,h,d){const p=!d,v=YU(f);v.aliasOf=d&&d.record;const y=MU(t,f),m=[v];if("alias"in f){const w=typeof f.alias=="string"?[f.alias]:f.alias;for(const x of w)m.push(YU(Kn({},v,{components:d?d.record.components:v.components,path:x,aliasOf:d?d.record:v})))}let b,S;for(const w of m){const{path:x}=w;if(h&&x[0]!=="/"){const T=h.record.path,C=T[T.length-1]==="/"?"":"/";w.path=h.record.path+(x&&C+x)}if(b=z_e(w,h,y),d?d.alias.push(b):(S=S||b,S!==b&&S.alias.push(b),p&&f.name&&!jU(b)&&a(f.name)),MK(b)&&l(b),v.children){const T=v.children;for(let C=0;C{a(S)}:Pb}function a(f){if(OK(f)){const h=r.get(f);h&&(r.delete(f),n.splice(n.indexOf(h),1),h.children.forEach(a),h.alias.forEach(a))}else{const h=n.indexOf(f);h>-1&&(n.splice(h,1),f.record.name&&r.delete(f.record.name),f.children.forEach(a),f.alias.forEach(a))}}function s(){return n}function l(f){const h=K_e(f,n);n.splice(h,0,f),f.record.name&&!jU(f)&&r.set(f.record.name,f)}function u(f,h){let d,p={},v,y;if("name"in f&&f.name){if(d=r.get(f.name),!d)throw vm(1,{location:f});y=d.record.name,p=Kn(zU(h.params,d.keys.filter(S=>!S.optional).concat(d.parent?d.parent.keys.filter(S=>S.optional):[]).map(S=>S.name)),f.params&&zU(f.params,d.keys.map(S=>S.name))),v=d.stringify(p)}else if(f.path!=null)v=f.path,d=n.find(S=>S.re.test(v)),d&&(p=d.parse(v),y=d.record.name,d.keys.forEach(S=>{S.optional&&!p[S.name]&&delete p[S.name]}));else{if(d=h.name?r.get(h.name):n.find(S=>S.re.test(h.path)),!d)throw vm(1,{location:f,currentLocation:h});y=d.record.name,p=Kn({},h.params,f.params),v=d.stringify(p)}const m=[];let b=d;for(;b;)m.unshift(b.record),b=b.parent;return{name:y,path:v,params:p,matched:m,meta:X_e(m)}}e.forEach(f=>o(f));function c(){n.length=0,r.clear()}return{addRoute:o,resolve:u,removeRoute:a,clearRoutes:c,getRoutes:s,getRecordMatcher:i}}function zU(e,t){const n={};for(const r of t)r in e&&(n[r]=e[r]);return n}function YU(e){const t={path:e.path,redirect:e.redirect,name:e.name,meta:e.meta||{},aliasOf:e.aliasOf,beforeEnter:e.beforeEnter,props:j_e(e),children:e.children||[],instances:{},leaveGuards:new Set,updateGuards:new Set,enterCallbacks:{},components:"components"in e?e.components||null:e.component&&{default:e.component}};return Object.defineProperty(t,"mods",{value:{}}),t}function j_e(e){const t={},n=e.props||!1;if("component"in e)t.default=n;else for(const r in e.components)t[r]=typeof n=="object"?n[r]:n;return t}function jU(e){for(;e;){if(e.record.aliasOf)return!0;e=e.parent}return!1}function X_e(e){return e.reduce((t,n)=>Kn(t,n.meta),{})}function K_e(e,t){let n=0,r=t.length;for(;n!==r;){const o=n+r>>1;NK(e,t[o])<0?r=o:n=o+1}const i=Z_e(e);return i&&(r=t.lastIndexOf(i,r-1)),r}function Z_e(e){let t=e;for(;t=t.parent;)if(MK(t)&&NK(e,t)===0)return t}function MK({record:e}){return!!(e.name||e.components&&Object.keys(e.components).length||e.redirect)}function XU(e){const t=Zo(NI),n=Zo(UM),r=ae(()=>{const l=R(e.to);return t.resolve(l)}),i=ae(()=>{const{matched:l}=r.value,{length:u}=l,c=l[u-1],f=n.matched;if(!c||!f.length)return-1;const h=f.findIndex(gm.bind(null,c));if(h>-1)return h;const d=KU(l[u-2]);return u>1&&KU(c)===d&&f[f.length-1].path!==d?f.findIndex(gm.bind(null,l[u-2])):h}),o=ae(()=>i.value>-1&&eSe(n.params,r.value.params)),a=ae(()=>i.value>-1&&i.value===n.matched.length-1&&DK(n.params,r.value.params));function s(l={}){if(q_e(l)){const u=t[R(e.replace)?"replace":"push"](R(e.to)).catch(Pb);return e.viewTransition&&typeof document<"u"&&"startViewTransition"in document&&document.startViewTransition(()=>u),u}return Promise.resolve()}return{route:r,href:ae(()=>r.value.href),isActive:o,isExactActive:a,navigate:s}}function J_e(e){return e.length===1?e[0]:e}const Q_e=Ye({name:"RouterLink",compatConfig:{MODE:3},props:{to:{type:[String,Object],required:!0},replace:Boolean,activeClass:String,exactActiveClass:String,custom:Boolean,ariaCurrentValue:{type:String,default:"page"},viewTransition:Boolean},useLink:XU,setup(e,{slots:t}){const n=io(XU(e)),{options:r}=Zo(NI),i=ae(()=>({[ZU(e.activeClass,r.linkActiveClass,"router-link-active")]:n.isActive,[ZU(e.exactActiveClass,r.linkExactActiveClass,"router-link-exact-active")]:n.isExactActive}));return()=>{const o=t.default&&J_e(t.default(n));return e.custom?o:Wn("a",{"aria-current":n.isExactActive?e.ariaCurrentValue:null,href:n.href,onClick:n.navigate,class:i.value},o)}}});function q_e(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&!(e.button!==void 0&&e.button!==0)){if(e.currentTarget&&e.currentTarget.getAttribute){const t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function eSe(e,t){for(const n in t){const r=t[n],i=e[n];if(typeof r=="string"){if(r!==i)return!1}else if(!gl(i)||i.length!==r.length||r.some((o,a)=>o.valueOf()!==i[a].valueOf()))return!1}return!0}function KU(e){return e?e.aliasOf?e.aliasOf.path:e.path:""}const ZU=(e,t,n)=>e??t??n,tSe=Ye({name:"RouterView",inheritAttrs:!1,props:{name:{type:String,default:"default"},route:Object},compatConfig:{MODE:3},setup(e,{attrs:t,slots:n}){const r=Zo(hO),i=ae(()=>e.route||r.value),o=Zo(FU,0),a=ae(()=>{let u=R(o);const{matched:c}=i.value;let f;for(;(f=c[u])&&!f.components;)u++;return u}),s=ae(()=>i.value.matched[a.value]);Og(FU,ae(()=>a.value+1)),Og(t_e,s),Og(hO,i);const l=me();return et(()=>[l.value,s.value,e.name],([u,c,f],[h,d,p])=>{c&&(c.instances[f]=u,d&&d!==c&&u&&u===h&&(c.leaveGuards.size||(c.leaveGuards=d.leaveGuards),c.updateGuards.size||(c.updateGuards=d.updateGuards))),u&&c&&(!d||!gm(c,d)||!h)&&(c.enterCallbacks[f]||[]).forEach(v=>v(u))},{flush:"post"}),()=>{const u=i.value,c=e.name,f=s.value,h=f&&f.components[c];if(!h)return JU(n.default,{Component:h,route:u});const d=f.props[c],p=d?d===!0?u.params:typeof d=="function"?d(u):d:null,y=Wn(h,Kn({},p,t,{onVnodeUnmounted:m=>{m.component.isUnmounted&&(f.instances[c]=null)},ref:l}));return JU(n.default,{Component:y,route:u})||y}}});function JU(e,t){if(!e)return null;const n=e(t);return n.length===1?n[0]:n}const WM=tSe;function nSe(e){const t=Y_e(e.routes,e),n=e.parseQuery||R_e,r=e.stringifyQuery||UU,i=e.history,o=a0(),a=a0(),s=a0(),l=mn(uf);let u=uf;ig&&e.scrollBehavior&&"scrollRestoration"in history&&(history.scrollRestoration="manual");const c=UR.bind(null,fe=>""+fe),f=UR.bind(null,p_e),h=UR.bind(null,WE);function d(fe,Le){let Ce,Ue;return OK(fe)?(Ce=t.getRecordMatcher(fe),Ue=Le):Ue=fe,t.addRoute(Ue,Ce)}function p(fe){const Le=t.getRecordMatcher(fe);Le&&t.removeRoute(Le)}function v(){return t.getRoutes().map(fe=>fe.record)}function y(fe){return!!t.getRecordMatcher(fe)}function m(fe,Le){if(Le=Kn({},Le||l.value),typeof fe=="string"){const ie=GR(n,fe,Le.path),ge=t.resolve({path:ie.path},Le),Te=i.createHref(ie.fullPath);return Kn(ie,ge,{params:h(ge.params),redirectedFrom:void 0,href:Te})}let Ce;if(fe.path!=null)Ce=Kn({},fe,{path:GR(n,fe.path,Le.path).path});else{const ie=Kn({},fe.params);for(const ge in ie)ie[ge]==null&&delete ie[ge];Ce=Kn({},fe,{params:f(ie)}),Le.params=f(Le.params)}const Ue=t.resolve(Ce,Le),Be=fe.hash||"";Ue.params=c(h(Ue.params));const Xe=m_e(r,Kn({},fe,{hash:f_e(Be),path:Ue.path})),J=i.createHref(Xe);return Kn({fullPath:Xe,hash:Be,query:r===UU?k_e(fe.query):fe.query||{}},Ue,{redirectedFrom:void 0,href:J})}function b(fe){return typeof fe=="string"?GR(n,fe,l.value.path):Kn({},fe)}function S(fe,Le){if(u!==fe)return vm(8,{from:Le,to:fe})}function w(fe){return C(fe)}function x(fe){return w(Kn(b(fe),{replace:!0}))}function T(fe,Le){const Ce=fe.matched[fe.matched.length-1];if(Ce&&Ce.redirect){const{redirect:Ue}=Ce;let Be=typeof Ue=="function"?Ue(fe,Le):Ue;return typeof Be=="string"&&(Be=Be.includes("?")||Be.includes("#")?Be=b(Be):{path:Be},Be.params={}),Kn({query:fe.query,hash:fe.hash,params:Be.path!=null?{}:fe.params},Be)}}function C(fe,Le){const Ce=u=m(fe),Ue=l.value,Be=fe.state,Xe=fe.force,J=fe.replace===!0,ie=T(Ce,Ue);if(ie)return C(Kn(b(ie),{state:typeof ie=="object"?Kn({},Be,ie.state):Be,force:Xe,replace:J}),Le||Ce);const ge=Ce;ge.redirectedFrom=Le;let Te;return!Xe&&y_e(r,Ue,Ce)&&(Te=vm(16,{to:ge,from:Ue}),re(Ue,Ue,!0,!1)),(Te?Promise.resolve(Te):L(ge,Ue)).catch(Oe=>Wu(Oe)?Wu(Oe,2)?Oe:ne(Oe):G(Oe,ge,Ue)).then(Oe=>{if(Oe){if(Wu(Oe,2))return C(Kn({replace:J},b(Oe.to),{state:typeof Oe.to=="object"?Kn({},Be,Oe.to.state):Be,force:Xe}),Le||ge)}else Oe=M(ge,Ue,!0,J,Be);return O(ge,Ue,Oe),Oe})}function P(fe,Le){const Ce=S(fe,Le);return Ce?Promise.reject(Ce):Promise.resolve()}function k(fe){const Le=Re.values().next().value;return Le&&typeof Le.runWithContext=="function"?Le.runWithContext(fe):fe()}function L(fe,Le){let Ce;const[Ue,Be,Xe]=P_e(fe,Le);Ce=HR(Ue.reverse(),"beforeRouteLeave",fe,Le);for(const ie of Ue)ie.leaveGuards.forEach(ge=>{Ce.push(Df(ge,fe,Le))});const J=P.bind(null,fe,Le);return Ce.push(J),be(Ce).then(()=>{Ce=[];for(const ie of o.list())Ce.push(Df(ie,fe,Le));return Ce.push(J),be(Ce)}).then(()=>{Ce=HR(Be,"beforeRouteUpdate",fe,Le);for(const ie of Be)ie.updateGuards.forEach(ge=>{Ce.push(Df(ge,fe,Le))});return Ce.push(J),be(Ce)}).then(()=>{Ce=[];for(const ie of Xe)if(ie.beforeEnter)if(gl(ie.beforeEnter))for(const ge of ie.beforeEnter)Ce.push(Df(ge,fe,Le));else Ce.push(Df(ie.beforeEnter,fe,Le));return Ce.push(J),be(Ce)}).then(()=>(fe.matched.forEach(ie=>ie.enterCallbacks={}),Ce=HR(Xe,"beforeRouteEnter",fe,Le,k),Ce.push(J),be(Ce))).then(()=>{Ce=[];for(const ie of a.list())Ce.push(Df(ie,fe,Le));return Ce.push(J),be(Ce)}).catch(ie=>Wu(ie,8)?ie:Promise.reject(ie))}function O(fe,Le,Ce){s.list().forEach(Ue=>k(()=>Ue(fe,Le,Ce)))}function M(fe,Le,Ce,Ue,Be){const Xe=S(fe,Le);if(Xe)return Xe;const J=Le===uf,ie=ig?history.state:{};Ce&&(Ue||J?i.replace(fe.fullPath,Kn({scroll:J&&ie&&ie.scroll},Be)):i.push(fe.fullPath,Be)),l.value=fe,re(fe,Le,Ce,J),ne()}let F;function U(){F||(F=i.listen((fe,Le,Ce)=>{if(!Me.listening)return;const Ue=m(fe),Be=T(Ue,Me.currentRoute.value);if(Be){C(Kn(Be,{replace:!0,force:!0}),Ue).catch(Pb);return}u=Ue;const Xe=l.value;ig&&C_e(VU(Xe.fullPath,Ce.delta),MI()),L(Ue,Xe).catch(J=>Wu(J,12)?J:Wu(J,2)?(C(Kn(b(J.to),{force:!0}),Ue).then(ie=>{Wu(ie,20)&&!Ce.delta&&Ce.type==="pop"&&i.go(-1,!1)}).catch(Pb),Promise.reject()):(Ce.delta&&i.go(-Ce.delta,!1),G(J,Ue,Xe))).then(J=>{J=J||M(Ue,Xe,!1),J&&(Ce.delta&&!Wu(J,8)?i.go(-Ce.delta,!1):Ce.type==="pop"&&Wu(J,20)&&i.go(-1,!1)),O(Ue,Xe,J)}).catch(Pb)}))}let X=a0(),$=a0(),W;function G(fe,Le,Ce){ne(fe);const Ue=$.list();return Ue.length?Ue.forEach(Be=>Be(fe,Le,Ce)):console.error(fe),Promise.reject(fe)}function Q(){return W&&l.value!==uf?Promise.resolve():new Promise((fe,Le)=>{X.add([fe,Le])})}function ne(fe){return W||(W=!fe,U(),X.list().forEach(([Le,Ce])=>fe?Ce(fe):Le()),X.reset()),fe}function re(fe,Le,Ce,Ue){const{scrollBehavior:Be}=e;if(!ig||!Be)return Promise.resolve();const Xe=!Ce&&I_e(VU(fe.fullPath,0))||(Ue||!Ce)&&history.state&&history.state.scroll||null;return Tr().then(()=>Be(fe,Le,Xe)).then(J=>J&&E_e(J)).catch(J=>G(J,fe,Le))}const pe=fe=>i.go(fe);let ke;const Re=new Set,Me={currentRoute:l,listening:!0,addRoute:d,removeRoute:p,clearRoutes:t.clearRoutes,hasRoute:y,getRoutes:v,resolve:m,options:e,push:w,replace:x,go:pe,back:()=>pe(-1),forward:()=>pe(1),beforeEach:o.add,beforeResolve:a.add,afterEach:s.add,onError:$.add,isReady:Q,install(fe){fe.component("RouterLink",Q_e),fe.component("RouterView",WM),fe.config.globalProperties.$router=Me,Object.defineProperty(fe.config.globalProperties,"$route",{enumerable:!0,get:()=>R(l)}),ig&&!ke&&l.value===uf&&(ke=!0,w(i.location).catch(Ue=>{}));const Le={};for(const Ue in uf)Object.defineProperty(Le,Ue,{get:()=>l.value[Ue],enumerable:!0});fe.provide(NI,Me),fe.provide(UM,YN(Le)),fe.provide(hO,l);const Ce=fe.unmount;Re.add(fe),fe.unmount=function(){Re.delete(fe),Re.size<1&&(u=uf,F&&F(),F=null,l.value=uf,ke=!1,W=!1),Ce()}}};function be(fe){return fe.reduce((Le,Ce)=>Le.then(()=>k(Ce)),Promise.resolve())}return Me}const k1=me(),gO=[],FK=()=>{k1.value||gO.length===0||(k1.value=gO.shift())},Xd=nm(k1),rSe=e=>new Promise(t=>{gO.push({...e,resolve:t}),FK()}),QU=e=>{const t=k1.value;t&&(k1.value=void 0,t.resolve(e),FK())},iSe=["aria-labelledby"],oSe=["onKeydown"],aSe={key:0,id:"dialog-title",class:"border-base-content/10 relative border-b px-4 py-2 text-base font-bold"},sSe=Ye({__name:"DialogWrapper",props:p1({noPadding:{type:Boolean},boxClass:{},title:{}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:p1(["enter"],["update:modelValue"]),setup(e,{emit:t}){const n=Yc(e,"modelValue"),r=t,i=me(void 0);et(n,s=>{s&&requestAnimationFrame(()=>{i.value?.focus()})});function o(){n.value=!1}function a(){r("enter")}return(s,l)=>(V(),qe(JN,{to:"#app-content"},[B(y1,{name:"modal"},{default:Ze(()=>[at(I("div",{ref:"backdropRef",class:"modal modal-open",role:"dialog","aria-modal":"true","aria-labelledby":e.title?"dialog-title":void 0,onKeydown:vl(o,["escape"])},[I("div",{class:"modal-backdrop w-screen","aria-hidden":"true",onClick:o}),I("div",{ref_key:"modalBoxRef",ref:i,class:tt(["modal-box bg-base-100 relative overflow-hidden p-0 outline-none",[R(Ec)<5&&"backdrop-blur-sm!",e.boxClass]]),tabindex:"-1",onClick:l[0]||(l[0]=Ot(()=>{},["stop"])),onKeydown:vl(Ot(a,["self"]),["enter"])},[e.title&&n.value?(V(),j("div",aSe,[yt(K(e.title)+" ",1),Ea(s.$slots,"title-right",{},void 0,!0),I("button",{type:"button",class:"btn btn-circle btn-ghost btn-xs absolute top-2 right-2","aria-label":"close",onClick:o},[B(R(Ca),{class:"h-4 w-4"})])])):Fe("",!0),n.value?(V(),j("div",{key:1,class:tt(["max-h-[90dvh] overflow-y-auto max-md:max-h-[70dvh]",e.noPadding?"p-0":"p-4"])},[Ea(s.$slots,"default",{},void 0,!0)],2)):Fe("",!0)],42,oSe)],40,iSe),[[op,n.value]])]),_:3})]))}}),wl=(e,t)=>{const n=e.__vccOpts||e;for(const[r,i]of t)n[r]=i;return n},Zr=wl(sSe,[["__scopeId","data-v-86efe155"]]),lSe={key:0,class:"flex max-h-[65dvh] min-h-0 flex-col gap-4 p-2 max-md:max-h-[50dvh]"},uSe={class:"min-h-0 overflow-y-auto overscroll-contain pr-1"},cSe={class:"text-sm break-all whitespace-pre-wrap"},fSe={class:"flex shrink-0 justify-end gap-2"},dSe=Ye({__name:"ConfirmDialogHost",setup(e){const t=me(!1);Sr(()=>{t.value=!0});const n=o=>{o||r()},r=()=>{QU(!1)},i=()=>{QU(!0)};return(o,a)=>t.value?(V(),qe(Zr,{key:0,"model-value":!!R(Xd),title:R(Xd)?.title,"box-class":"max-w-lg","onUpdate:modelValue":n,onEnter:i},{default:Ze(()=>[R(Xd)?(V(),j("div",lSe,[I("div",uSe,[I("p",cSe,K(R(Xd).message),1)]),I("div",fSe,[I("button",{class:"btn btn-sm",onClick:r},K(R(Xd).cancelText||o.$t("cancel")),1),I("button",{class:tt(["btn btn-sm",R(Xd).confirmButtonClass||"btn-primary"]),onClick:i},K(R(Xd).confirmText||o.$t("confirm")),3)])])):Fe("",!0)]),_:1},8,["model-value","title"])):Fe("",!0)}});var IT={exports:{}},hSe=IT.exports,qU;function pSe(){return qU||(qU=1,(function(e){(function(t,n){e.exports?e.exports=n():t.ReconnectingWebSocket=n()})(hSe,function(){if(!("WebSocket"in window))return;function t(n,r,i){var o={debug:!1,automaticOpen:!0,reconnectInterval:1e3,maxReconnectInterval:3e4,reconnectDecay:1.5,timeoutInterval:2e3,maxReconnectAttempts:null};i||(i={});for(var a in o)typeof i[a]<"u"?this[a]=i[a]:this[a]=o[a];this.url=n,this.reconnectAttempts=0,this.readyState=WebSocket.CONNECTING,this.protocol=null;var s=this,l,u=!1,c=!1,f=document.createElement("div");f.addEventListener("open",function(d){s.onopen(d)}),f.addEventListener("close",function(d){s.onclose(d)}),f.addEventListener("connecting",function(d){s.onconnecting(d)}),f.addEventListener("message",function(d){s.onmessage(d)}),f.addEventListener("error",function(d){s.onerror(d)}),this.addEventListener=f.addEventListener.bind(f),this.removeEventListener=f.removeEventListener.bind(f),this.dispatchEvent=f.dispatchEvent.bind(f);function h(d,p){var v=document.createEvent("CustomEvent");return v.initCustomEvent(d,!1,!1,p),v}this.open=function(d){if(l=new WebSocket(s.url,r||[]),d){if(this.maxReconnectAttempts&&this.reconnectAttempts>this.maxReconnectAttempts)return}else f.dispatchEvent(h("connecting")),this.reconnectAttempts=0;(s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","attempt-connect",s.url);var p=l,v=setTimeout(function(){(s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","connection-timeout",s.url),c=!0,p.close(),c=!1},s.timeoutInterval);l.onopen=function(y){clearTimeout(v),(s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","onopen",s.url),s.protocol=l.protocol,s.readyState=WebSocket.OPEN,s.reconnectAttempts=0;var m=h("open");m.isReconnect=d,d=!1,f.dispatchEvent(m)},l.onclose=function(y){if(clearTimeout(b),l=null,u)s.readyState=WebSocket.CLOSED,f.dispatchEvent(h("close"));else{s.readyState=WebSocket.CONNECTING;var m=h("connecting");m.code=y.code,m.reason=y.reason,m.wasClean=y.wasClean,f.dispatchEvent(m),!d&&!c&&((s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","onclose",s.url),f.dispatchEvent(h("close")));var b=s.reconnectInterval*Math.pow(s.reconnectDecay,s.reconnectAttempts);setTimeout(function(){s.reconnectAttempts++,s.open(!0)},b>s.maxReconnectInterval?s.maxReconnectInterval:b)}},l.onmessage=function(y){(s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","onmessage",s.url,y.data);var m=h("message");m.data=y.data,f.dispatchEvent(m)},l.onerror=function(y){(s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","onerror",s.url,y),f.dispatchEvent(h("error"))}},this.automaticOpen==!0&&this.open(!1),this.send=function(d){if(l)return(s.debug||t.debugAll)&&console.debug("ReconnectingWebSocket","send",s.url,d),l.send(d);throw"INVALID_STATE_ERR : Pausing to reconnect websocket"},this.close=function(d,p){typeof d>"u"&&(d=1e3),u=!0,l&&l.close(d,p)},this.refresh=function(){l&&l.close()}}return t.prototype.onopen=function(n){},t.prototype.onclose=function(n){},t.prototype.onconnecting=function(n){},t.prototype.onmessage=function(n){},t.prototype.onerror=function(n){},t.debugAll=!1,t.CONNECTING=WebSocket.CONNECTING,t.OPEN=WebSocket.OPEN,t.CLOSING=WebSocket.CLOSING,t.CLOSED=WebSocket.CLOSED,t})})(IT)),IT.exports}var vSe=pSe();const gSe=ly(vSe),mSe=()=>Dt.get("/version"),met=()=>Dt.get("/proxies"),yet=(e,t)=>Dt.put(`/proxies/${encodeURIComponent(e)}`,{name:t}),bet=e=>Dt.delete(`/proxies/${encodeURIComponent(e)}`),_et=(e,t,n)=>Dt.get(`/proxies/${encodeURIComponent(e)}/delay`,{params:{url:t,timeout:n}}),wet=(e,t,n,r)=>Dt.get(`/providers/proxies/${encodeURIComponent(e)}/${encodeURIComponent(t)}/healthcheck`,{params:{url:n,timeout:r}}),xet=(e,t,n)=>Dt.get(`/group/${encodeURIComponent(e)}/delay`,{params:{url:t,timeout:n}}),ySe=()=>Dt.get("/group/weights"),bSe=e=>Dt.get(`/group/${encodeURIComponent(e)}/weights`),_Se=()=>Dt.post("/cache/smart/flush"),Tet=()=>Dt.get("/providers/proxies"),$K=e=>Dt.put(`/providers/proxies/${encodeURIComponent(e)}`),SSe=e=>Dt.get(`/providers/proxies/${encodeURIComponent(e)}/healthcheck`,{timeout:15e3}),Eet=()=>Dt.get("/rules"),wSe=e=>Dt.patch("/rules/disable",e),xSe=e=>Dt.put(`/rules/${encodeURIComponent(e)}`),Cet=()=>Dt.get("/providers/rules"),zM=e=>Dt.put(`/providers/rules/${encodeURIComponent(e)}`),BK=e=>Dt.delete(`/connections/smart/${e}`),TSe=e=>Dt.delete(`/connections/${e}`),ESe=()=>Dt.delete("/connections"),Iet=()=>Dt.get("/configs"),Aet=e=>Dt.patch("/configs",e),CSe=()=>Dt.post("/cache/fakeip/flush"),ISe=()=>Dt.post("/cache/dns/flush"),ASe=()=>Dt.put("/configs?reload=true",{path:"",payload:""}),RSe=(e,t=!1)=>Dt.put(`/configs${t?"?force=true":""}`,{path:e.path||"",payload:e.payload||""}),VK=()=>Dt.post("/upgrade/ui"),kSe=()=>Dt.post("/configs/geo"),UK=e=>{const t=e==="auto"?"/upgrade":`/upgrade?channel=${e}`;return Dt.post(t)},PSe=()=>Dt.post("/restart"),DSe=e=>Dt.get("/dns/query",{params:e}),OSe=()=>Dt.get("/storage/zashboard"),LSe=e=>Dt.put("/storage/zashboard",e),NSe=()=>Dt.delete("/storage/zashboard"),FI=(e,t)=>{const n=Sn.value,r=new URL(`${SM(n).replace("http","ws")}/${e}`);r.searchParams.append("token",n.password||""),t&&Object.entries(t).forEach(([l,u])=>{r.searchParams.append(l,u)});const i=me(),o=new gSe(r.toString()),a=()=>{o.close()},s=({data:l})=>{i.value=JSON.parse(l)};return o.onmessage=e==="logs"?s:Jn.debounce(s,100),{data:i,close:a}},MSe=async(e,t)=>{const n=new AbortController,r=setTimeout(()=>n.abort(),t);try{return(await fetch(`${SM(e)}/version`,{method:"GET",headers:{Authorization:`Bearer ${e.password}`},signal:n.signal})).ok}catch{return!1}finally{clearTimeout(r)}},Vi=ae(()=>Sn.value?.type==="singbox"),s0=ae(()=>!!Sn.value&&!Vi.value),FSe=ae(()=>Vi.value),YM=ae(()=>({proxies:!!Sn.value,connections:!!Sn.value,logs:!!Sn.value,overview:!!Sn.value,rules:s0.value,providers:s0.value,dns:s0.value,smart:s0.value,upgrade:s0.value,tools:Vi.value})),jM=(e,t=1e4)=>z_(e)?es(()=>Promise.resolve().then(()=>T5),void 0,import.meta.url).then(n=>n.probeSingboxChannel(e,t)):Promise.resolve(!1),zE=(e,t=1e4)=>e.type==="singbox"?jM(e,t):MSe(e,t),sc=me(),YE=me(!1),mO=me("3.14.0"),GK=me(0),Db=me(0),Ai=ae(()=>sc.value?.includes("sing-box")),yO=ae(()=>{if(!Ai.value){const e=/(alpha-smart|alpha|beta|meta)-?(\w+)/.exec(sc.value);switch(e?.[1]){case"alpha":return[Vh.Alpha,e[2]??sc.value];case"alpha-smart":return[Vh.Smart,e[2]??sc.value];case"meta":return[Vh.Meta,e[2]??sc.value];default:return[Vh.Meta,sc.value]}}}),$Se=async()=>{const{getSingboxClient:e}=await es(async()=>{const{getSingboxClient:i}=await Promise.resolve().then(()=>T5);return{getSingboxClient:i}},void 0,import.meta.url),t=e()?.client;if(!t)return{data:{version:"sing-box"}};const n=await t.getVersion({});return GK.value=n.apiVersion,{data:{version:n.version.includes("sing-box")?n.version:`sing-box ${n.version}`}}},BSe=()=>Vi.value?$Se():(GK.value=0,mSe()),VSe=async()=>{const{getSingboxClient:e}=await es(async()=>{const{getSingboxClient:n}=await Promise.resolve().then(()=>T5);return{getSingboxClient:n}},void 0,import.meta.url),t=e()?.client;if(!t)return 0;try{const n=await t.getStartedAt({});return Number(n.startedAt)}catch{return 0}};et(Sn,async e=>{if(e){const{data:t}=await BSe();if(sc.value=t?.version||"",Db.value=Vi.value?await VSe():0,Ai.value||!Eh.value||Sn.value?.disableUpgradeCore)return;YE.value=await WSe(),YE.value&&eb.value&&UK("auto")}},{immediate:!0});const USe=1e3*60*60;async function HK(e,t){const n="cache/"+e,r=localStorage.getItem(n);if(r)try{const s=JSON.parse(r);if(Date.now()-s.timestamp{const{tag_name:e}=await HK("https://api.github.com/repos/Zephyruso/zashboard/releases/latest",mO.value);return!!(e&&e!==`v${mO.value}`)},HSe=async(e,t)=>{const{assets:n}=await HK(e,t);return!n.some(({name:i})=>i.includes(t))},WSe=async()=>await HSe(uX[yO.value?.[0]??Vh.Meta].check_update_url,yO.value?.[1]??sc.value),bO=me(!1),zSe=async()=>{bO.value=await GSe(),bO.value&&tT.value&&VK()},_O=me(""),Xi=me(xo.PROXIES),Io=me([]),or=me({}),YSe=Qe("cache/ipv6-map",{}),jE=Qe("config/hidden-group-map",{}),du=me([]),e8=ae(()=>fT.value||aX),WK=e=>{if(!e||!Uh.value)return e8.value;const t=Tf.value.find(r=>r.name===e);return t?t.url:(or.value[e]||du.value.find(r=>r.name===e))?.testUrl||e8.value},jSe=e=>Jn.last(e)?.delay??Is,J_=(e,t)=>{const n=zK(e,t);return jSe(n)},zK=(e,t)=>{if(Uh.value&&!Ai.value){const r=or.value[e],i=WK(t);return r?(r?.extra||(r.extra={}),r.extra?.[i]||(r.extra[i]={history:[],alive:!0}),r?.extra?.[i]?.history):[]}return or.value[Wh(e)]?.history},XSe=e=>YSe.value[Wh(e)],Wh=e=>{let t=or.value[e];if(!e||!t)return e;for(;t.now&&t.now!==t.name;){const n=or.value[t.now];if(!n)return t.name;t=n}return t.name},YK=e=>{let t=or.value[e];if(!t)return[];const n=[e];for(;t.now&&t.now!==t.name&&Io.value.includes(t.now);)n.push(t.now),t=or.value[t.now];return n},jK=ae(()=>Object.values(or.value).some(e=>e.type.toLowerCase()===Uo.Smart)),Q_=()=>Vi.value?es(()=>import("./singbox-B6XsvqM8.js"),[],import.meta.url):es(()=>import("./clash-C0zJ2EIl.js"),[],import.meta.url),wu=async()=>(await Q_()).fetchProxies(),XM=async(e,t)=>(await Q_()).handlerProxySelect(e,t),KSe=async(e,t,n,r)=>(await Q_()).proxyLatencyTest(e,t,n,r),XK=async e=>(await Q_()).proxyGroupLatencyTest(e),ZSe=async()=>(await Q_()).allProxiesLatencyTest(),JSe=async()=>{(await es(()=>import("./singbox-B6XsvqM8.js"),[],import.meta.url)).resetProxies()};var WR={},l0={},t8;function QSe(){if(t8)return l0;t8=1,l0.byteLength=s,l0.toByteArray=u,l0.fromByteArray=h;for(var e=[],t=[],n=typeof Uint8Array<"u"?Uint8Array:Array,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=r.length;i0)throw new Error("Invalid string. Length must be a multiple of 4");var v=d.indexOf("=");v===-1&&(v=p);var y=v===p?0:4-v%4;return[v,y]}function s(d){var p=a(d),v=p[0],y=p[1];return(v+y)*3/4-y}function l(d,p,v){return(p+v)*3/4-v}function u(d){var p,v=a(d),y=v[0],m=v[1],b=new n(l(d,y,m)),S=0,w=m>0?y-4:y,x;for(x=0;x>16&255,b[S++]=p>>8&255,b[S++]=p&255;return m===2&&(p=t[d.charCodeAt(x)]<<2|t[d.charCodeAt(x+1)]>>4,b[S++]=p&255),m===1&&(p=t[d.charCodeAt(x)]<<10|t[d.charCodeAt(x+1)]<<4|t[d.charCodeAt(x+2)]>>2,b[S++]=p>>8&255,b[S++]=p&255),b}function c(d){return e[d>>18&63]+e[d>>12&63]+e[d>>6&63]+e[d&63]}function f(d,p,v){for(var y,m=[],b=p;bw?w:S+b));return y===1?(p=d[v-1],m.push(e[p>>2]+e[p<<4&63]+"==")):y===2&&(p=(d[v-2]<<8)+d[v-1],m.push(e[p>>10]+e[p>>4&63]+e[p<<2&63]+"=")),m.join("")}return l0}var Dw={};var n8;function qSe(){return n8||(n8=1,Dw.read=function(e,t,n,r,i){var o,a,s=i*8-r-1,l=(1<>1,c=-7,f=n?i-1:0,h=n?-1:1,d=e[t+f];for(f+=h,o=d&(1<<-c)-1,d>>=-c,c+=s;c>0;o=o*256+e[t+f],f+=h,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=r;c>0;a=a*256+e[t+f],f+=h,c-=8);if(o===0)o=1-u;else{if(o===l)return a?NaN:(d?-1:1)*(1/0);a=a+Math.pow(2,r),o=o-u}return(d?-1:1)*a*Math.pow(2,o-r)},Dw.write=function(e,t,n,r,i,o){var a,s,l,u=o*8-i-1,c=(1<>1,h=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:o-1,p=r?1:-1,v=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+f>=1?t+=h/l:t+=h*Math.pow(2,1-f),t*l>=2&&(a++,l/=2),a+f>=c?(s=0,a=c):a+f>=1?(s=(t*l-1)*Math.pow(2,i),a=a+f):(s=t*Math.pow(2,f-1)*Math.pow(2,i),a=0));i>=8;e[n+d]=s&255,d+=p,s/=256,i-=8);for(a=a<0;e[n+d]=a&255,d+=p,a/=256,u-=8);e[n+d-p]|=v*128}),Dw}var r8;function ewe(){return r8||(r8=1,(function(e){const t=QSe(),n=qSe(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50;const i=2147483647;e.kMaxLength=i,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{const Y=new Uint8Array(1),D={foo:function(){return 42}};return Object.setPrototypeOf(D,Uint8Array.prototype),Object.setPrototypeOf(Y,D),Y.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function a(Y){if(Y>i)throw new RangeError('The value "'+Y+'" is invalid for option "size"');const D=new Uint8Array(Y);return Object.setPrototypeOf(D,s.prototype),D}function s(Y,D,A){if(typeof Y=="number"){if(typeof D=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return f(Y)}return l(Y,D,A)}s.poolSize=8192;function l(Y,D,A){if(typeof Y=="string")return h(Y,D);if(ArrayBuffer.isView(Y))return p(Y);if(Y==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y);if(Pe(Y,ArrayBuffer)||Y&&Pe(Y.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pe(Y,SharedArrayBuffer)||Y&&Pe(Y.buffer,SharedArrayBuffer)))return v(Y,D,A);if(typeof Y=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const H=Y.valueOf&&Y.valueOf();if(H!=null&&H!==Y)return s.from(H,D,A);const q=y(Y);if(q)return q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Y[Symbol.toPrimitive]=="function")return s.from(Y[Symbol.toPrimitive]("string"),D,A);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Y)}s.from=function(Y,D,A){return l(Y,D,A)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(Y){if(typeof Y!="number")throw new TypeError('"size" argument must be of type number');if(Y<0)throw new RangeError('The value "'+Y+'" is invalid for option "size"')}function c(Y,D,A){return u(Y),Y<=0?a(Y):D!==void 0?typeof A=="string"?a(Y).fill(D,A):a(Y).fill(D):a(Y)}s.alloc=function(Y,D,A){return c(Y,D,A)};function f(Y){return u(Y),a(Y<0?0:m(Y)|0)}s.allocUnsafe=function(Y){return f(Y)},s.allocUnsafeSlow=function(Y){return f(Y)};function h(Y,D){if((typeof D!="string"||D==="")&&(D="utf8"),!s.isEncoding(D))throw new TypeError("Unknown encoding: "+D);const A=S(Y,D)|0;let H=a(A);const q=H.write(Y,D);return q!==A&&(H=H.slice(0,q)),H}function d(Y){const D=Y.length<0?0:m(Y.length)|0,A=a(D);for(let H=0;H=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return Y|0}function b(Y){return+Y!=Y&&(Y=0),s.alloc(+Y)}s.isBuffer=function(D){return D!=null&&D._isBuffer===!0&&D!==s.prototype},s.compare=function(D,A){if(Pe(D,Uint8Array)&&(D=s.from(D,D.offset,D.byteLength)),Pe(A,Uint8Array)&&(A=s.from(A,A.offset,A.byteLength)),!s.isBuffer(D)||!s.isBuffer(A))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(D===A)return 0;let H=D.length,q=A.length;for(let le=0,_e=Math.min(H,q);le<_e;++le)if(D[le]!==A[le]){H=D[le],q=A[le];break}return Hq.length?(s.isBuffer(_e)||(_e=s.from(_e)),_e.copy(q,le)):Uint8Array.prototype.set.call(q,_e,le);else if(s.isBuffer(_e))_e.copy(q,le);else throw new TypeError('"list" argument must be an Array of Buffers');le+=_e.length}return q};function S(Y,D){if(s.isBuffer(Y))return Y.length;if(ArrayBuffer.isView(Y)||Pe(Y,ArrayBuffer))return Y.byteLength;if(typeof Y!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Y);const A=Y.length,H=arguments.length>2&&arguments[2]===!0;if(!H&&A===0)return 0;let q=!1;for(;;)switch(D){case"ascii":case"latin1":case"binary":return A;case"utf8":case"utf-8":return Oe(Y).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return A*2;case"hex":return A>>>1;case"base64":return ve(Y).length;default:if(q)return H?-1:Oe(Y).length;D=(""+D).toLowerCase(),q=!0}}s.byteLength=S;function w(Y,D,A){let H=!1;if((D===void 0||D<0)&&(D=0),D>this.length||((A===void 0||A>this.length)&&(A=this.length),A<=0)||(A>>>=0,D>>>=0,A<=D))return"";for(Y||(Y="utf8");;)switch(Y){case"hex":return Q(this,D,A);case"utf8":case"utf-8":return U(this,D,A);case"ascii":return W(this,D,A);case"latin1":case"binary":return G(this,D,A);case"base64":return F(this,D,A);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ne(this,D,A);default:if(H)throw new TypeError("Unknown encoding: "+Y);Y=(Y+"").toLowerCase(),H=!0}}s.prototype._isBuffer=!0;function x(Y,D,A){const H=Y[D];Y[D]=Y[A],Y[A]=H}s.prototype.swap16=function(){const D=this.length;if(D%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let A=0;AA&&(D+=" ... "),""},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(D,A,H,q,le){if(Pe(D,Uint8Array)&&(D=s.from(D,D.offset,D.byteLength)),!s.isBuffer(D))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof D);if(A===void 0&&(A=0),H===void 0&&(H=D?D.length:0),q===void 0&&(q=0),le===void 0&&(le=this.length),A<0||H>D.length||q<0||le>this.length)throw new RangeError("out of range index");if(q>=le&&A>=H)return 0;if(q>=le)return-1;if(A>=H)return 1;if(A>>>=0,H>>>=0,q>>>=0,le>>>=0,this===D)return 0;let _e=le-q,he=H-A;const Ge=Math.min(_e,he),He=this.slice(q,le),rt=D.slice(A,H);for(let je=0;je2147483647?A=2147483647:A<-2147483648&&(A=-2147483648),A=+A,ze(A)&&(A=q?0:Y.length-1),A<0&&(A=Y.length+A),A>=Y.length){if(q)return-1;A=Y.length-1}else if(A<0)if(q)A=0;else return-1;if(typeof D=="string"&&(D=s.from(D,H)),s.isBuffer(D))return D.length===0?-1:C(Y,D,A,H,q);if(typeof D=="number")return D=D&255,typeof Uint8Array.prototype.indexOf=="function"?q?Uint8Array.prototype.indexOf.call(Y,D,A):Uint8Array.prototype.lastIndexOf.call(Y,D,A):C(Y,[D],A,H,q);throw new TypeError("val must be string, number or Buffer")}function C(Y,D,A,H,q){let le=1,_e=Y.length,he=D.length;if(H!==void 0&&(H=String(H).toLowerCase(),H==="ucs2"||H==="ucs-2"||H==="utf16le"||H==="utf-16le")){if(Y.length<2||D.length<2)return-1;le=2,_e/=2,he/=2,A/=2}function Ge(rt,je){return le===1?rt[je]:rt.readUInt16BE(je*le)}let He;if(q){let rt=-1;for(He=A;He<_e;He++)if(Ge(Y,He)===Ge(D,rt===-1?0:He-rt)){if(rt===-1&&(rt=He),He-rt+1===he)return rt*le}else rt!==-1&&(He-=He-rt),rt=-1}else for(A+he>_e&&(A=_e-he),He=A;He>=0;He--){let rt=!0;for(let je=0;jeq&&(H=q)):H=q;const le=D.length;H>le/2&&(H=le/2);let _e;for(_e=0;_e>>0,isFinite(H)?(H=H>>>0,q===void 0&&(q="utf8")):(q=H,H=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const le=this.length-A;if((H===void 0||H>le)&&(H=le),D.length>0&&(H<0||A<0)||A>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let _e=!1;for(;;)switch(q){case"hex":return P(this,D,A,H);case"utf8":case"utf-8":return k(this,D,A,H);case"ascii":case"latin1":case"binary":return L(this,D,A,H);case"base64":return O(this,D,A,H);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,D,A,H);default:if(_e)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),_e=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function F(Y,D,A){return D===0&&A===Y.length?t.fromByteArray(Y):t.fromByteArray(Y.slice(D,A))}function U(Y,D,A){A=Math.min(Y.length,A);const H=[];let q=D;for(;q239?4:le>223?3:le>191?2:1;if(q+he<=A){let Ge,He,rt,je;switch(he){case 1:le<128&&(_e=le);break;case 2:Ge=Y[q+1],(Ge&192)===128&&(je=(le&31)<<6|Ge&63,je>127&&(_e=je));break;case 3:Ge=Y[q+1],He=Y[q+2],(Ge&192)===128&&(He&192)===128&&(je=(le&15)<<12|(Ge&63)<<6|He&63,je>2047&&(je<55296||je>57343)&&(_e=je));break;case 4:Ge=Y[q+1],He=Y[q+2],rt=Y[q+3],(Ge&192)===128&&(He&192)===128&&(rt&192)===128&&(je=(le&15)<<18|(Ge&63)<<12|(He&63)<<6|rt&63,je>65535&&je<1114112&&(_e=je))}}_e===null?(_e=65533,he=1):_e>65535&&(_e-=65536,H.push(_e>>>10&1023|55296),_e=56320|_e&1023),H.push(_e),q+=he}return $(H)}const X=4096;function $(Y){const D=Y.length;if(D<=X)return String.fromCharCode.apply(String,Y);let A="",H=0;for(;HH)&&(A=H);let q="";for(let le=D;leH&&(D=H),A<0?(A+=H,A<0&&(A=0)):A>H&&(A=H),AA)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(D,A,H){D=D>>>0,A=A>>>0,H||re(D,A,this.length);let q=this[D],le=1,_e=0;for(;++_e>>0,A=A>>>0,H||re(D,A,this.length);let q=this[D+--A],le=1;for(;A>0&&(le*=256);)q+=this[D+--A]*le;return q},s.prototype.readUint8=s.prototype.readUInt8=function(D,A){return D=D>>>0,A||re(D,1,this.length),this[D]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(D,A){return D=D>>>0,A||re(D,2,this.length),this[D]|this[D+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(D,A){return D=D>>>0,A||re(D,2,this.length),this[D]<<8|this[D+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(D,A){return D=D>>>0,A||re(D,4,this.length),(this[D]|this[D+1]<<8|this[D+2]<<16)+this[D+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(D,A){return D=D>>>0,A||re(D,4,this.length),this[D]*16777216+(this[D+1]<<16|this[D+2]<<8|this[D+3])},s.prototype.readBigUInt64LE=Ie(function(D){D=D>>>0,J(D,"offset");const A=this[D],H=this[D+7];(A===void 0||H===void 0)&&ie(D,this.length-8);const q=A+this[++D]*2**8+this[++D]*2**16+this[++D]*2**24,le=this[++D]+this[++D]*2**8+this[++D]*2**16+H*2**24;return BigInt(q)+(BigInt(le)<>>0,J(D,"offset");const A=this[D],H=this[D+7];(A===void 0||H===void 0)&&ie(D,this.length-8);const q=A*2**24+this[++D]*2**16+this[++D]*2**8+this[++D],le=this[++D]*2**24+this[++D]*2**16+this[++D]*2**8+H;return(BigInt(q)<>>0,A=A>>>0,H||re(D,A,this.length);let q=this[D],le=1,_e=0;for(;++_e=le&&(q-=Math.pow(2,8*A)),q},s.prototype.readIntBE=function(D,A,H){D=D>>>0,A=A>>>0,H||re(D,A,this.length);let q=A,le=1,_e=this[D+--q];for(;q>0&&(le*=256);)_e+=this[D+--q]*le;return le*=128,_e>=le&&(_e-=Math.pow(2,8*A)),_e},s.prototype.readInt8=function(D,A){return D=D>>>0,A||re(D,1,this.length),this[D]&128?(255-this[D]+1)*-1:this[D]},s.prototype.readInt16LE=function(D,A){D=D>>>0,A||re(D,2,this.length);const H=this[D]|this[D+1]<<8;return H&32768?H|4294901760:H},s.prototype.readInt16BE=function(D,A){D=D>>>0,A||re(D,2,this.length);const H=this[D+1]|this[D]<<8;return H&32768?H|4294901760:H},s.prototype.readInt32LE=function(D,A){return D=D>>>0,A||re(D,4,this.length),this[D]|this[D+1]<<8|this[D+2]<<16|this[D+3]<<24},s.prototype.readInt32BE=function(D,A){return D=D>>>0,A||re(D,4,this.length),this[D]<<24|this[D+1]<<16|this[D+2]<<8|this[D+3]},s.prototype.readBigInt64LE=Ie(function(D){D=D>>>0,J(D,"offset");const A=this[D],H=this[D+7];(A===void 0||H===void 0)&&ie(D,this.length-8);const q=this[D+4]+this[D+5]*2**8+this[D+6]*2**16+(H<<24);return(BigInt(q)<>>0,J(D,"offset");const A=this[D],H=this[D+7];(A===void 0||H===void 0)&&ie(D,this.length-8);const q=(A<<24)+this[++D]*2**16+this[++D]*2**8+this[++D];return(BigInt(q)<>>0,A||re(D,4,this.length),n.read(this,D,!0,23,4)},s.prototype.readFloatBE=function(D,A){return D=D>>>0,A||re(D,4,this.length),n.read(this,D,!1,23,4)},s.prototype.readDoubleLE=function(D,A){return D=D>>>0,A||re(D,8,this.length),n.read(this,D,!0,52,8)},s.prototype.readDoubleBE=function(D,A){return D=D>>>0,A||re(D,8,this.length),n.read(this,D,!1,52,8)};function pe(Y,D,A,H,q,le){if(!s.isBuffer(Y))throw new TypeError('"buffer" argument must be a Buffer instance');if(D>q||DY.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(D,A,H,q){if(D=+D,A=A>>>0,H=H>>>0,!q){const he=Math.pow(2,8*H)-1;pe(this,D,A,H,he,0)}let le=1,_e=0;for(this[A]=D&255;++_e>>0,H=H>>>0,!q){const he=Math.pow(2,8*H)-1;pe(this,D,A,H,he,0)}let le=H-1,_e=1;for(this[A+le]=D&255;--le>=0&&(_e*=256);)this[A+le]=D/_e&255;return A+H},s.prototype.writeUint8=s.prototype.writeUInt8=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,1,255,0),this[A]=D&255,A+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,2,65535,0),this[A]=D&255,this[A+1]=D>>>8,A+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,2,65535,0),this[A]=D>>>8,this[A+1]=D&255,A+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,4,4294967295,0),this[A+3]=D>>>24,this[A+2]=D>>>16,this[A+1]=D>>>8,this[A]=D&255,A+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,4,4294967295,0),this[A]=D>>>24,this[A+1]=D>>>16,this[A+2]=D>>>8,this[A+3]=D&255,A+4};function ke(Y,D,A,H,q){Xe(D,H,q,Y,A,7);let le=Number(D&BigInt(4294967295));Y[A++]=le,le=le>>8,Y[A++]=le,le=le>>8,Y[A++]=le,le=le>>8,Y[A++]=le;let _e=Number(D>>BigInt(32)&BigInt(4294967295));return Y[A++]=_e,_e=_e>>8,Y[A++]=_e,_e=_e>>8,Y[A++]=_e,_e=_e>>8,Y[A++]=_e,A}function Re(Y,D,A,H,q){Xe(D,H,q,Y,A,7);let le=Number(D&BigInt(4294967295));Y[A+7]=le,le=le>>8,Y[A+6]=le,le=le>>8,Y[A+5]=le,le=le>>8,Y[A+4]=le;let _e=Number(D>>BigInt(32)&BigInt(4294967295));return Y[A+3]=_e,_e=_e>>8,Y[A+2]=_e,_e=_e>>8,Y[A+1]=_e,_e=_e>>8,Y[A]=_e,A+8}s.prototype.writeBigUInt64LE=Ie(function(D,A=0){return ke(this,D,A,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=Ie(function(D,A=0){return Re(this,D,A,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(D,A,H,q){if(D=+D,A=A>>>0,!q){const Ge=Math.pow(2,8*H-1);pe(this,D,A,H,Ge-1,-Ge)}let le=0,_e=1,he=0;for(this[A]=D&255;++le>0)-he&255;return A+H},s.prototype.writeIntBE=function(D,A,H,q){if(D=+D,A=A>>>0,!q){const Ge=Math.pow(2,8*H-1);pe(this,D,A,H,Ge-1,-Ge)}let le=H-1,_e=1,he=0;for(this[A+le]=D&255;--le>=0&&(_e*=256);)D<0&&he===0&&this[A+le+1]!==0&&(he=1),this[A+le]=(D/_e>>0)-he&255;return A+H},s.prototype.writeInt8=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,1,127,-128),D<0&&(D=255+D+1),this[A]=D&255,A+1},s.prototype.writeInt16LE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,2,32767,-32768),this[A]=D&255,this[A+1]=D>>>8,A+2},s.prototype.writeInt16BE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,2,32767,-32768),this[A]=D>>>8,this[A+1]=D&255,A+2},s.prototype.writeInt32LE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,4,2147483647,-2147483648),this[A]=D&255,this[A+1]=D>>>8,this[A+2]=D>>>16,this[A+3]=D>>>24,A+4},s.prototype.writeInt32BE=function(D,A,H){return D=+D,A=A>>>0,H||pe(this,D,A,4,2147483647,-2147483648),D<0&&(D=4294967295+D+1),this[A]=D>>>24,this[A+1]=D>>>16,this[A+2]=D>>>8,this[A+3]=D&255,A+4},s.prototype.writeBigInt64LE=Ie(function(D,A=0){return ke(this,D,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=Ie(function(D,A=0){return Re(this,D,A,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Me(Y,D,A,H,q,le){if(A+H>Y.length)throw new RangeError("Index out of range");if(A<0)throw new RangeError("Index out of range")}function be(Y,D,A,H,q){return D=+D,A=A>>>0,q||Me(Y,D,A,4),n.write(Y,D,A,H,23,4),A+4}s.prototype.writeFloatLE=function(D,A,H){return be(this,D,A,!0,H)},s.prototype.writeFloatBE=function(D,A,H){return be(this,D,A,!1,H)};function fe(Y,D,A,H,q){return D=+D,A=A>>>0,q||Me(Y,D,A,8),n.write(Y,D,A,H,52,8),A+8}s.prototype.writeDoubleLE=function(D,A,H){return fe(this,D,A,!0,H)},s.prototype.writeDoubleBE=function(D,A,H){return fe(this,D,A,!1,H)},s.prototype.copy=function(D,A,H,q){if(!s.isBuffer(D))throw new TypeError("argument should be a Buffer");if(H||(H=0),!q&&q!==0&&(q=this.length),A>=D.length&&(A=D.length),A||(A=0),q>0&&q=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),D.length-A>>0,H=H===void 0?this.length:H>>>0,D||(D=0);let le;if(typeof D=="number")for(le=A;le2**32?q=Ue(String(A)):typeof A=="bigint"&&(q=String(A),(A>BigInt(2)**BigInt(32)||A<-(BigInt(2)**BigInt(32)))&&(q=Ue(q)),q+="n"),H+=` It must be ${D}. Received ${q}`,H},RangeError);function Ue(Y){let D="",A=Y.length;const H=Y[0]==="-"?1:0;for(;A>=H+4;A-=3)D=`_${Y.slice(A-3,A)}${D}`;return`${Y.slice(0,A)}${D}`}function Be(Y,D,A){J(D,"offset"),(Y[D]===void 0||Y[D+A]===void 0)&&ie(D,Y.length-(A+1))}function Xe(Y,D,A,H,q,le){if(Y>A||Y= 0${_e} and < 2${_e} ** ${(le+1)*8}${_e}`:he=`>= -(2${_e} ** ${(le+1)*8-1}${_e}) and < 2 ** ${(le+1)*8-1}${_e}`,new Le.ERR_OUT_OF_RANGE("value",he,Y)}Be(H,q,le)}function J(Y,D){if(typeof Y!="number")throw new Le.ERR_INVALID_ARG_TYPE(D,"number",Y)}function ie(Y,D,A){throw Math.floor(Y)!==Y?(J(Y,A),new Le.ERR_OUT_OF_RANGE("offset","an integer",Y)):D<0?new Le.ERR_BUFFER_OUT_OF_BOUNDS:new Le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${D}`,Y)}const ge=/[^+/0-9A-Za-z-_]/g;function Te(Y){if(Y=Y.split("=")[0],Y=Y.trim().replace(ge,""),Y.length<2)return"";for(;Y.length%4!==0;)Y=Y+"=";return Y}function Oe(Y,D){D=D||1/0;let A;const H=Y.length;let q=null;const le=[];for(let _e=0;_e55295&&A<57344){if(!q){if(A>56319){(D-=3)>-1&&le.push(239,191,189);continue}else if(_e+1===H){(D-=3)>-1&&le.push(239,191,189);continue}q=A;continue}if(A<56320){(D-=3)>-1&&le.push(239,191,189),q=A;continue}A=(q-55296<<10|A-56320)+65536}else q&&(D-=3)>-1&&le.push(239,191,189);if(q=null,A<128){if((D-=1)<0)break;le.push(A)}else if(A<2048){if((D-=2)<0)break;le.push(A>>6|192,A&63|128)}else if(A<65536){if((D-=3)<0)break;le.push(A>>12|224,A>>6&63|128,A&63|128)}else if(A<1114112){if((D-=4)<0)break;le.push(A>>18|240,A>>12&63|128,A>>6&63|128,A&63|128)}else throw new Error("Invalid code point")}return le}function Z(Y){const D=[];for(let A=0;A>8,q=A%256,le.push(q),le.push(H);return le}function ve(Y){return t.toByteArray(Te(Y))}function xe(Y,D,A,H){let q;for(q=0;q=D.length||q>=Y.length);++q)D[q+A]=Y[q];return q}function Pe(Y,D){return Y instanceof D||Y!=null&&Y.constructor!=null&&Y.constructor.name!=null&&Y.constructor.name===D.name}function ze(Y){return Y!==Y}const de=(function(){const Y="0123456789abcdef",D=new Array(256);for(let A=0;A<16;++A){const H=A*16;for(let q=0;q<16;++q)D[H+q]=Y[A]+Y[q]}return D})();function Ie(Y){return typeof BigInt>"u"?it:Y}function it(){throw new Error("BigInt not supported")}})(WR)),WR}var KK=ewe(),AT={exports:{}},twe=AT.exports,i8;function nwe(){return i8||(i8=1,(function(e){(function(t){const n="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${n}\\.${n}\\.${n}\\.${n}$`,"i"),threeOctet:new RegExp(`^${n}\\.${n}\\.${n}$`,"i"),twoOctet:new RegExp(`^${n}\\.${n}$`,"i"),longValue:new RegExp(`^${n}$`,"i")},i=new RegExp("^0[0-7]+$","i"),o=new RegExp("^0x[a-f0-9]+$","i"),a="%[0-9a-z]{1,}",s="(?:[0-9a-f]+::?)+",l={zoneIndex:new RegExp(a,"i"),native:new RegExp(`^(::)?(${s})?([0-9a-f]+)?(::)?(${a})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${n}\\.${n}\\.${n}\\.${n}(${a})?)$`,"i"),transitional:new RegExp(`^((?:${s})|(?:::)(?:${s})?)${n}\\.${n}\\.${n}\\.${n}(${a})?$`,"i")};function u(p,v){if(p.indexOf("::")!==p.lastIndexOf("::"))return null;let y=0,m=-1,b=(p.match(l.zoneIndex)||[])[0],S,w;for(b&&(b=b.substring(1),p=p.replace(/%.+$/,""));(m=p.indexOf(":",m+1))>=0;)y++;if(p.substr(0,2)==="::"&&y--,p.substr(-2,2)==="::"&&y--,y>v)return null;for(w=v-y,S=":";w--;)S+="0:";return p=p.replace("::",S),p[0]===":"&&(p=p.slice(1)),p[p.length-1]===":"&&(p=p.slice(0,-1)),v=(function(){const x=p.split(":"),T=[];for(let C=0;C0;){if(S=y-m,S<0&&(S=0),p[b]>>S!==v[b]>>S)return!1;m-=y,b+=1}return!0}function f(p){if(o.test(p))return parseInt(p,16);if(p[0]==="0"&&!isNaN(parseInt(p[1],10))){if(i.test(p))return parseInt(p,8);throw new Error(`ipaddr: cannot parse ${p} as octal`)}return parseInt(p,10)}function h(p,v){for(;p.length=0;b-=1)if(S=this.octets[b],S in m){if(w=m[S],y&&w!==0)return null;w!==8&&(y=!0),v+=w}else return null;return 32-v},p.prototype.range=function(){return d.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){return this.octets.slice(0)},p.prototype.toIPv4MappedAddress=function(){return d.IPv6.parse(`::ffff:${this.toString()}`)},p.prototype.toNormalizedString=function(){return this.toString()},p.prototype.toString=function(){return this.octets.join(".")},p})(),d.IPv4.broadcastAddressFromCIDR=function(p){try{const v=this.parseCIDR(p),y=v[0].toByteArray(),m=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),b=[];let S=0;for(;S<4;)b.push(parseInt(y[S],10)|parseInt(m[S],10)^255),S++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},d.IPv4.isIPv4=function(p){return this.parser(p)!==null},d.IPv4.isValid=function(p){try{return new this(this.parser(p)),!0}catch{return!1}},d.IPv4.isValidCIDR=function(p){try{return this.parseCIDR(p),!0}catch{return!1}},d.IPv4.isValidFourPartDecimal=function(p){return!!(d.IPv4.isValid(p)&&p.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},d.IPv4.isValidCIDRFourPartDecimal=function(p){const v=p.match(/^(.+)\/(\d+)$/);return!d.IPv4.isValidCIDR(p)||!v?!1:d.IPv4.isValidFourPartDecimal(v[1])},d.IPv4.networkAddressFromCIDR=function(p){let v,y,m,b,S;try{for(v=this.parseCIDR(p),m=v[0].toByteArray(),S=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),b=[],y=0;y<4;)b.push(parseInt(m[y],10)&parseInt(S[y],10)),y++;return new this(b)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},d.IPv4.parse=function(p){const v=this.parser(p);if(v===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(v)},d.IPv4.parseCIDR=function(p){let v;if(v=p.match(/^(.+)\/(\d+)$/)){const y=parseInt(v[2]);if(y>=0&&y<=32){const m=[this.parse(v[1]),y];return Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},d.IPv4.parser=function(p){let v,y,m;if(v=p.match(r.fourOctet))return(function(){const b=v.slice(1,6),S=[];for(let w=0;w4294967295||m<0)throw new Error("ipaddr: address outside defined range");return(function(){const b=[];let S;for(S=0;S<=24;S+=8)b.push(m>>S&255);return b})().reverse()}else return(v=p.match(r.twoOctet))?(function(){const b=v.slice(1,4),S=[];if(m=f(b[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return S.push(f(b[0])),S.push(m>>16&255),S.push(m>>8&255),S.push(m&255),S})():(v=p.match(r.threeOctet))?(function(){const b=v.slice(1,5),S=[];if(m=f(b[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return S.push(f(b[0])),S.push(f(b[1])),S.push(m>>8&255),S.push(m&255),S})():null},d.IPv4.subnetMaskFromPrefixLength=function(p){if(p=parseInt(p),p<0||p>32)throw new Error("ipaddr: invalid IPv4 prefix length");const v=[0,0,0,0];let y=0;const m=Math.floor(p/8);for(;y=0;w-=1)if(b=this.parts[w],b in m){if(S=m[b],y&&S!==0)return null;S!==16&&(y=!0),v+=S}else return null;return 128-v},p.prototype.range=function(){return d.subnetMatch(this,this.SpecialRanges)},p.prototype.toByteArray=function(){let v;const y=[],m=this.parts;for(let b=0;b>8),y.push(v&255);return y},p.prototype.toFixedLengthString=function(){const v=(function(){const m=[];for(let b=0;b>8,y&255,m>>8,m&255])},p.prototype.toNormalizedString=function(){const v=(function(){const m=[];for(let b=0;bb&&(m=S.index,b=S[0].length);return b<0?y:`${y.substring(0,m)}::${y.substring(m+b)}`},p.prototype.toString=function(){return this.toRFC5952String()},p})(),d.IPv6.broadcastAddressFromCIDR=function(p){try{const v=this.parseCIDR(p),y=v[0].toByteArray(),m=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),b=[];let S=0;for(;S<16;)b.push(parseInt(y[S],10)|parseInt(m[S],10)^255),S++;return new this(b)}catch(v){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${v})`)}},d.IPv6.isIPv6=function(p){return this.parser(p)!==null},d.IPv6.isValid=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{const v=this.parser(p);return new this(v.parts,v.zoneId),!0}catch{return!1}},d.IPv6.isValidCIDR=function(p){if(typeof p=="string"&&p.indexOf(":")===-1)return!1;try{return this.parseCIDR(p),!0}catch{return!1}},d.IPv6.networkAddressFromCIDR=function(p){let v,y,m,b,S;try{for(v=this.parseCIDR(p),m=v[0].toByteArray(),S=this.subnetMaskFromPrefixLength(v[1]).toByteArray(),b=[],y=0;y<16;)b.push(parseInt(m[y],10)&parseInt(S[y],10)),y++;return new this(b)}catch(w){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${w})`)}},d.IPv6.parse=function(p){const v=this.parser(p);if(v.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(v.parts,v.zoneId)},d.IPv6.parseCIDR=function(p){let v,y,m;if((y=p.match(/^(.+)\/(\d+)$/))&&(v=parseInt(y[2]),v>=0&&v<=128))return m=[this.parse(y[1]),v],Object.defineProperty(m,"toString",{value:function(){return this.join("/")}}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},d.IPv6.parser=function(p){let v,y,m,b,S,w;if(m=p.match(l.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(l.native.test(p))return u(p,8);if((m=p.match(l.transitional))&&(w=m[6]||"",v=m[1],m[1].endsWith("::")||(v=v.slice(0,-1)),v=u(v+w,6),v.parts)){for(S=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],y=0;y128)throw new Error("ipaddr: invalid IPv6 prefix length");const v=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let y=0;const m=Math.floor(p/8);for(;yawait(await fetch("https://myip.ipip.net/json?t="+Date.now())).json(),iwe=async(e="")=>await(await fetch("https://api.ip.sb/geoip"+(e?`/${e}`:"")+"?t="+Date.now())).json(),owe=async(e="")=>await(await fetch("https://ipwho.is"+(e?`/${e}`:"")+"?t="+Date.now())).json(),awe=async(e="")=>await(await fetch("https://api.ipapi.is"+(e?`/?q=${e}`:"")+(e?"&":"?")+"t="+Date.now())).json(),KM=async(e="")=>{switch(Bg.value){case Fg.IPAPI:const t=await awe(e);return{ip:t.ip,country:t.location.country,region:t.location.state,city:t.location.city,asn:t.asn.asn?.toString(),organization:t.asn.org};case Fg.IPWHOIS:const n=await owe(e);return{ip:n.ip,region:n.region,country:n.country,city:n.city,asn:n.connection.asn?.toString(),organization:n.connection.org};case Fg.IPSB:default:const r=await iwe(e);return{ip:r.ip,country:r.country,region:r.region,city:r.city,asn:r.asn?.toString(),organization:r.organization}}},swe="zashboard-geoip",P1="mmdb",lwe=720*60*60*1e3,ZK=()=>new Promise((e,t)=>{const n=indexedDB.open(swe,1);n.onupgradeneeded=()=>{n.result.createObjectStore(P1)},n.onsuccess=()=>e(n.result),n.onerror=()=>t(n.error)}),uwe=async e=>{const t=await ZK();return new Promise((n,r)=>{const i=t.transaction(P1,"readonly").objectStore(P1).get(e);i.onsuccess=()=>n(i.result),i.onerror=()=>r(i.error)}).finally(()=>t.close())},cwe=async(e,t)=>{const n=await ZK();return new Promise((r,i)=>{const o=n.transaction(P1,"readwrite");o.objectStore(P1).put(t,e),o.oncomplete=()=>r(),o.onerror=()=>i(o.error)}).finally(()=>n.close())},fwe=async e=>{let t=await uwe(e).catch(()=>{});if(!t||Date.now()-t.updatedAt>lwe)try{const r=await fetch(e);if(!r.ok)throw new Error(`Failed to download GeoIP database: ${r.status}`);t={buffer:await r.arrayBuffer(),updatedAt:Date.now()},await cwe(e,t).catch(()=>{})}catch(r){if(!t)throw r}const{Reader:n}=await es(async()=>{const{Reader:r}=await import("./index-BhwfYd4S.js").then(i=>i.i);return{Reader:r}},[],import.meta.url);return new n(KK.Buffer.from(t.buffer))},dwe=4,Ju=new Map,hwe=e=>{const t=Ju.get(e);if(t)return Ju.delete(e),Ju.set(e,t),t;const n=fwe(e).catch(r=>{throw Ju.delete(e),r});for(Ju.set(e,n);Ju.size>dwe;){const r=Ju.keys().next().value;if(r===void 0)break;Ju.delete(r)}return n},pwe=e=>e?ru.value===Yo.ZH_CN||ru.value===Yo.ZH_TW?e["zh-CN"]??e.en:e.en:"",a8=async(e,t)=>{const n=await hwe(e);try{return n.get(t)}catch{return null}},vwe=async e=>{const[t,n]=await Promise.all([a8(Cb.value,e),a8(Ib.value,e)]);return{ip:e,country:pwe(t?.country?.names)||(t?.country?.iso_code??""),region:"",city:"",asn:n?.autonomous_system_number?.toString()??"",organization:n?.autonomous_system_organization??""}},s8={ip:"",country:"",region:"",city:"",asn:"",organization:""},gwe=4096,og=io(new Map),RT=new Set,mwe=e=>{if(!e||!Za.isValid(e))return s8;const t=og.get(e);return t||(RT.has(e)||(RT.add(e),vwe(e).then(n=>{for(og.set(e,n);og.size>gwe;){const r=og.keys().next().value;if(r===void 0)break;og.delete(r)}}).catch(()=>{}).finally(()=>RT.delete(e))),s8)};Nge([Cb,Ib],()=>{Ju.clear(),og.clear(),RT.clear()},{debounce:800});const ywe=256,zh=new Map,Ob=new Map,SO=[],wO=[],bwe=()=>{zh.clear(),Ob.clear(),SO.length=0,wO.length=0;for(const{key:e,label:t,scope:n}of Ti.value)if(!(n&&!n.includes(Sn.value?.uuid))){if(e.startsWith("/")){SO.push({regex:new RegExp(e.slice(1),"i"),label:t});continue}if(e.includes("/"))try{const r=Za.parseCIDR(e);wO.push({cidr:r,label:t});continue}catch{}Ob.set(e,t)}},u0=(e,t)=>{if(zh.set(e,t),zh.size>ywe){const n=zh.keys().next().value;n&&zh.delete(n)}return t};et(()=>[Ti.value,Sn.value],bwe,{immediate:!0,deep:!0});const D1=e=>{if(!e)return e===""?"Inner":"";if(zh.has(e))return zh.get(e);const n=Za.isValid(e)?Za.parse(e):null;if(n?.kind()==="ipv6"){for(const[r,i]of Ob.entries())if(e.endsWith(r))return u0(e,i)}if(Ob.has(e))return u0(e,Ob.get(e));for(const{regex:r,label:i}of SO)if(r.test(e))return u0(e,i);if(n){for(const{cidr:r,label:i}of wO)if(n.match(r))return u0(e,i)}return u0(e,e)},_we=e=>Za.IPv4.isIPv4(e)?"IPv4":Za.IPv6.isIPv6(e)?"IPv6":"FQDN",Swe=(e,t,n)=>{let r=e.chains(t);return(n.mode==="card"||!n.showFullProxyChain)&&r.length>2&&(r=[r[0],r[r.length-1]]),n.proxyChainDirection===Xp.REVERSE?r:[...r].reverse()},ZM=e=>(t,n,r)=>{switch(n){case Se.Type:return e.networkType(t);case Se.Process:return e.process(t);case Se.Host:return e.host(t);case Se.Rule:return e.rule(t);case Se.Chains:return Swe(e,t,r).join(" → ");case Se.Outbound:return e.chains(t)[0]||"";case Se.DlSpeed:return`${yn(t.downloadSpeed)}/s`;case Se.UlSpeed:return`${yn(t.uploadSpeed)}/s`;case Se.Download:return yn(e.download(t));case Se.Upload:return yn(e.upload(t));case Se.ConnectTime:return _M(e.start(t));case Se.SourceIP:return D1(e.sourceIP(t));case Se.SourcePort:return e.sourcePort(t);case Se.SniffHost:return e.sniffHost(t)||"-";case Se.Destination:return e.destination(t);case Se.DestinationType:return _we(e.destination(t));case Se.GeoIP:{const{country:i,organization:o}=mwe(e.destination(t));return[i,o].filter(Boolean).join(" / ")}case Se.RemoteAddress:return e.remoteAddress(t)||"-";case Se.InboundUser:return e.inboundUser(t);case Se.Protocol:return e.protocol(t)||"-";case Se.OutboundType:return e.outboundType(t)||"-";case Se.FromOutbound:return e.fromOutbound(t)||"-";case Se.Close:return""}},JK=e=>(t,n,r)=>{const i=ZM(e);return n.filter(o=>o!==Se.Close).map(o=>i(t,o,r))},wwe=TSe,xwe=ESe,Twe=()=>{const e=FI("connections"),t=me();let n=new Map;const r=et(e.data,i=>{if(!i)return;const o=new Map,a=(i.connections??[]).map(l=>{const u=l,c=n.get(u.id);return c?(u.downloadSpeed=Hr(u).download-Hr(c).download,u.uploadSpeed=Hr(u).upload-Hr(c).upload):(u.downloadSpeed=0,u.uploadSpeed=0),n.delete(u.id),o.set(u.id,u),u}),s=Array.from(n.values());n=o,t.value={active:a,closed:s,downloadTotal:i.downloadTotal,uploadTotal:i.uploadTotal}});return{data:t,close:()=>{r(),e.close()}}},Hr=e=>e,l8=e=>{const{destinationPort:t,sniffHost:n,network:r}=e.metadata;return(t==="443"||n)&&r==="udp"?"quic":r},u8=e=>e.metadata.host||e.metadata.sniffHost||e.metadata.destinationIP,JM={chains:e=>Hr(e).chains,download:e=>Hr(e).download,upload:e=>Hr(e).upload,start:e=>Hr(e).start,rule:e=>{const t=Hr(e);return t.rulePayload?`${t.rule}: ${t.rulePayload}`:t.rule},rulePayload:e=>Hr(e).rulePayload,sourceIP:e=>Hr(e).metadata.sourceIP,sourcePort:e=>Hr(e).metadata.sourcePort,network:e=>l8(Hr(e)),networkType:e=>{const t=Hr(e);return`${t.metadata.type} | ${l8(t)}`},hostname:e=>u8(Hr(e)),host:e=>{const t=Hr(e),n=u8(t);return n.includes(":")?`[${n}]:${t.metadata.destinationPort}`:`${n}:${t.metadata.destinationPort}`},process:e=>{const{metadata:t}=Hr(e);return t.process||t.processPath.replace(/^.*[/\\](.*)$/,"$1")||"-"},destination:e=>{const t=Hr(e);return or.value[Jn.head(t.chains)||""]?.type.toLowerCase()===Uo.Direct&&t.metadata.remoteDestination?t.metadata.remoteDestination:t.metadata.destinationIP||t.metadata.host},inboundUser:e=>{const{metadata:t}=Hr(e);return t.inboundUser||t.inboundName||t.inboundPort||"-"},sniffHost:e=>Hr(e).metadata.sniffHost,remoteAddress:e=>Hr(e).metadata.remoteDestination,protocol:()=>"",outboundType:()=>"",fromOutbound:()=>"",smartBlock:e=>Hr(e).metadata.smartBlock},Ewe=ZM(JM),Cwe=JK(JM),Iwe=Object.freeze(Object.defineProperty({__proto__:null,connectionAccessor:JM,disconnectAllAPI:xwe,disconnectByIdAPI:wwe,fetchConnectionsAPI:Twe,getConnectionDisplayValue:Ewe,getConnectionVisibleSearchValues:Cwe},Symbol.toStringTag,{value:"Module"}));function mm(e){let t=!1;const n=[];for(let r=0;r"_"+t.toLowerCase())}const Awe=new Set(["constructor","toString","toJSON","valueOf"]);function O1(e){return Awe.has(e)?e+"$":e}function Rwe(){let e=0,t=0;for(let r=0;r<28;r+=7){let i=this.buf[this.pos++];if(e|=(i&127)<>4,(n&128)==0)return this.assertBounds(),[e,t];for(let r=3;r<=31;r+=7){let i=this.buf[this.pos++];if(t|=(i&127)<>>o,s=!(!(a>>>7)&&t==0),l=(s?a|128:a)&255;if(n.push(l),!s)return}const r=e>>>28&15|(t&7)<<4,i=t>>3!=0;if(n.push((i?r|128:r)&255),!!i){for(let o=3;o<31;o=o+7){const a=t>>>o,s=!!(a>>>7),l=(s?a|128:a)&255;if(n.push(l),!s)return}n.push(t>>>31&1)}}const kT=4294967296;function c8(e){const t=e[0]==="-";t&&(e=e.slice(1));const n=1e6;let r=0,i=0;function o(a,s){const l=Number(e.slice(a,s));i*=n,r=r*n+l,r>=kT&&(i=i+(r/kT|0),r=r%kT)}return o(-24,-18),o(-18,-12),o(-12,-6),o(-6),t?eZ(r,i):QM(r,i)}function kwe(e,t){let n=QM(e,t);const r=n.hi&2147483648;r&&(n=eZ(n.lo,n.hi));const i=qK(n.lo,n.hi);return r?"-"+i:i}function qK(e,t){if({lo:e,hi:t}=Pwe(e,t),t<=2097151)return String(kT*t+e);const n=e&16777215,r=(e>>>24|t<<8)&16777215,i=t>>16&65535;let o=n+r*6777216+i*6710656,a=r+i*8147497,s=i*2;const l=1e7;return o>=l&&(a+=Math.floor(o/l),o%=l),a>=l&&(s+=Math.floor(a/l),a%=l),s.toString()+f8(a)+f8(o)}function Pwe(e,t){return{lo:e>>>0,hi:t>>>0}}function QM(e,t){return{lo:e|0,hi:t|0}}function eZ(e,t){return t=~t,e?e=~e+1:t+=1,QM(e,t)}const f8=e=>{const t=String(e);return"0000000".slice(t.length)+t};function xO(e,t){if(e>=0){for(;e>127;)t.push(e&127|128),e=e>>>7;t.push(e)}else{for(let n=0;n<9;n++)t.push(e&127|128),e=e>>7;t.push(1)}}function Dwe(){let e=this.buf[this.pos++],t=e&127;if((e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<7,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<14,(e&128)==0)return this.assertBounds(),t;if(e=this.buf[this.pos++],t|=(e&127)<<21,(e&128)==0)return this.assertBounds(),t;e=this.buf[this.pos++],t|=(e&15)<<28;for(let n=5;(e&128)!==0&&n<10;n++)e=this.buf[this.pos++];if((e&128)!=0)throw new Error("invalid varint");return this.assertBounds(),t>>>0}var d8={};const kr=Owe();function Owe(){const e=new DataView(new ArrayBuffer(8));if(typeof BigInt=="function"&&typeof e.getBigInt64=="function"&&typeof e.getBigUint64=="function"&&typeof e.setBigInt64=="function"&&typeof e.setBigUint64=="function"&&(!!globalThis.Deno||typeof process!="object"||typeof d8!="object"||d8.BUF_BIGINT_DISABLE!=="1")){const n=BigInt("-9223372036854775808"),r=BigInt("9223372036854775807"),i=BigInt("0"),o=BigInt("18446744073709551615");return{zero:BigInt(0),supported:!0,parse(a){const s=typeof a=="bigint"?a:BigInt(a);if(s>r||so||sr.localName===n)}function Nwe(e,t){const n=t.localName;if(t.oneof)return e[t.oneof.localName].case===n;if(t.presence!=tZ)return e[n]!==void 0&&Object.prototype.hasOwnProperty.call(e,n);switch(t.fieldKind){case"list":return e[n].length>0;case"map":return Object.keys(e[n]).length>0;case"scalar":return!Lwe(t.scalar,e[n]);case"enum":return e[n]!==t.enum.values[0].number}throw new Error("message field with implicit presence")}function L1(e,t){return Object.prototype.hasOwnProperty.call(e,t)&&e[t]!==void 0}function rZ(e,t){if(t.oneof){const n=e[t.oneof.localName];return n.case===t.localName?n.value:void 0}return e[t.localName]}function iZ(e,t,n){t.oneof?e[t.oneof.localName]={case:t.localName,value:n}:e[t.localName]=n}function Mwe(e,t){const n=t.localName;if(t.oneof){const r=t.oneof.localName;e[r].case===n&&(e[r]={case:void 0})}else if(t.presence!=tZ)delete e[n];else switch(t.fieldKind){case"map":e[n]={};break;case"list":e[n]=[];break;case"enum":e[n]=t.enum.values[0].number;break;case"scalar":e[n]=ym(t.scalar,t.longAsString);break}}function qM(e){for(const t of e.field)L1(t,"jsonName")||(t.jsonName=mm(t.name));e.nestedType.forEach(qM)}function Fwe(e,t){const n=e.values.find(r=>r.name===t);if(!n)throw new Error(`cannot parse ${e} default value: ${t}`);return n.number}function $we(e,t){switch(e){case De.STRING:return t;case De.BYTES:{const n=Bwe(t);if(n===!1)throw new Error(`cannot parse ${De[e]} default value: ${t}`);return n}case De.INT64:case De.SFIXED64:case De.SINT64:return kr.parse(t);case De.UINT64:case De.FIXED64:return kr.uParse(t);case De.DOUBLE:case De.FLOAT:switch(t){case"inf":return Number.POSITIVE_INFINITY;case"-inf":return Number.NEGATIVE_INFINITY;case"nan":return Number.NaN;default:return parseFloat(t)}case De.BOOL:return t==="true";case De.INT32:case De.UINT32:case De.SINT32:case De.FIXED32:case De.SFIXED32:return parseInt(t,10)}}function Bwe(e){const t=[],n={tail:e,c:"",next(){return this.tail.length==0?!1:(this.c=this.tail[0],this.tail=this.tail.substring(1),!0)},take(r){if(this.tail.length>=r){const i=this.tail.substring(0,r);return this.tail=this.tail.substring(r),i}return!1}};for(;n.next();)switch(n.c){case"\\":if(n.next())switch(n.c){case"\\":t.push(n.c.charCodeAt(0));break;case"b":t.push(8);break;case"f":t.push(12);break;case"n":t.push(10);break;case"r":t.push(13);break;case"t":t.push(9);break;case"v":t.push(11);break;case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":{const r=n.c,i=n.take(2);if(i===!1)return!1;const o=parseInt(r+i,8);if(Number.isNaN(o))return!1;t.push(o);break}case"x":{const r=n.c,i=n.take(2);if(i===!1)return!1;const o=parseInt(r+i,16);if(Number.isNaN(o))return!1;t.push(o);break}case"u":{const r=n.c,i=n.take(4);if(i===!1)return!1;const o=parseInt(r+i,16);if(Number.isNaN(o))return!1;const a=new Uint8Array(4);new DataView(a.buffer).setInt32(0,o,!0),t.push(a[0],a[1],a[2],a[3]);break}case"U":{const r=n.c,i=n.take(8);if(i===!1)return!1;const o=kr.uEnc(r+i),a=new Uint8Array(8),s=new DataView(a.buffer);s.setInt32(0,o.lo,!0),s.setInt32(4,o.hi,!0),t.push(a[0],a[1],a[2],a[3],a[4],a[5],a[6],a[7]);break}}break;default:t.push(n.c.charCodeAt(0))}return new Uint8Array(t)}function*TO(e){switch(e.kind){case"file":for(const t of e.messages)yield t,yield*TO(t);yield*e.enums,yield*e.services,yield*e.extensions;break;case"message":for(const t of e.nestedMessages)yield t,yield*TO(t);yield*e.nestedEnums,yield*e.nestedExtensions;break}}function oZ(...e){const t=Vwe();if(!e.length)return t;if("$typeName"in e[0]&&e[0].$typeName=="google.protobuf.FileDescriptorSet"){for(const n of e[0].file)y8(n,t);return t}if("$typeName"in e[0]){let o=function(a){const s=[];for(const l of a.dependency){if(t.getFile(l)!=null||i.has(l))continue;const u=r(l);if(!u)throw new Error(`Unable to resolve ${l}, imported by ${a.name}`);"kind"in u?t.addFile(u,!1,!0):(i.add(u.name),s.push(u))}return s.concat(...s.map(o))};const n=e[0],r=e[1],i=new Set;for(const a of[n,...o(n)].reverse())y8(a,t)}else for(const n of e)for(const r of n.files)t.addFile(r);return t}function Vwe(){const e=new Map,t=new Map,n=new Map;return{kind:"registry",types:e,extendees:t,[Symbol.iterator](){return e.values()},get files(){return n.values()},addFile(r,i,o){if(n.set(r.proto.name,r),!i)for(const a of TO(r))this.add(a);if(o)for(const a of r.dependencies)this.addFile(a,i,o)},add(r){if(r.kind=="extension"){let i=t.get(r.extendee.typeName);i||t.set(r.extendee.typeName,i=new Map),i.set(r.number,r)}e.set(r.typeName,r)},get(r){return e.get(r)},getFile(r){return n.get(r)},getMessage(r){const i=e.get(r);return i?.kind=="message"?i:void 0},getEnum(r){const i=e.get(r);return i?.kind=="enum"?i:void 0},getExtension(r){const i=e.get(r);return i?.kind=="extension"?i:void 0},getExtensionFor(r,i){var o;return(o=t.get(r.typeName))===null||o===void 0?void 0:o.get(i)},getService(r){const i=e.get(r);return i?.kind=="service"?i:void 0}}}const Uwe=998,Gwe=999,Hwe=9999,Wwe=9,N1=10,Lb=11,zwe=12,v8=14,e5=3,Ywe=2,g8=1,jwe=0,YR=1,m8=2,Xwe=3,Kwe=1,Zwe=2,Jwe=1,Qwe=2,qwe=1001,aZ={998:{fieldPresence:1,enumType:2,repeatedFieldEncoding:2,utf8Validation:3,messageEncoding:1,jsonFormat:2,enforceNamingStyle:2,defaultSymbolVisibility:1},999:{fieldPresence:2,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1e3:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:2,defaultSymbolVisibility:1},1001:{fieldPresence:1,enumType:1,repeatedFieldEncoding:1,utf8Validation:2,messageEncoding:1,jsonFormat:1,enforceNamingStyle:1,defaultSymbolVisibility:2}};function y8(e,t){var n,r;const i={kind:"file",proto:e,deprecated:(r=(n=e.options)===null||n===void 0?void 0:n.deprecated)!==null&&r!==void 0?r:!1,edition:rxe(e),name:e.name.replace(/\.proto$/,""),dependencies:ixe(e,t),enums:[],messages:[],extensions:[],services:[],toString(){return`file ${e.name}`}},o=new Map,a={get(s){return o.get(s)},add(s){var l;ol(((l=s.proto.options)===null||l===void 0?void 0:l.mapEntry)===!0),o.set(s.typeName,s)}};for(const s of e.enumType)sZ(s,i,void 0,t);for(const s of e.messageType)lZ(s,i,void 0,t,a);for(const s of e.service)exe(s,i,t);EO(i,t);for(const s of o.values())CO(s,t,a);for(const s of i.messages)CO(s,t,a),EO(s,t);t.addFile(i,!0)}function EO(e,t){switch(e.kind){case"file":for(const n of e.proto.extension){const r=IO(n,e,t);e.extensions.push(r),t.add(r)}break;case"message":for(const n of e.proto.extension){const r=IO(n,e,t);e.nestedExtensions.push(r),t.add(r)}for(const n of e.nestedMessages)EO(n,t);break}}function CO(e,t,n){const r=e.proto.oneofDecl.map(o=>nxe(o,e)),i=new Set;for(const o of e.proto.field){const a=sxe(o,r),s=IO(o,e,t,a,n);e.fields.push(s),e.field[s.localName]=s,a===void 0?e.members.push(s):(a.fields.push(s),i.has(a)||(i.add(a),e.members.push(a)))}for(const o of r.filter(a=>i.has(a)))e.oneofs.push(o);for(const o of e.nestedMessages)CO(o,t,n)}function sZ(e,t,n,r){var i,o,a,s,l;const u=oxe(e.name,e.value),c={kind:"enum",proto:e,deprecated:(o=(i=e.options)===null||i===void 0?void 0:i.deprecated)!==null&&o!==void 0?o:!1,file:t,parent:n,open:!0,name:e.name,typeName:$I(e,n,t),value:{},values:[],sharedPrefix:u,toString(){return`enum ${this.typeName}`}};c.open=fxe(c),r.add(c);for(const f of e.value){const h=f.name;c.values.push(c.value[f.number]={kind:"enum_value",proto:f,deprecated:(s=(a=f.options)===null||a===void 0?void 0:a.deprecated)!==null&&s!==void 0?s:!1,parent:c,name:h,localName:O1(u==null?h:h.substring(u.length)),number:f.number,toString(){return`enum value ${c.typeName}.${h}`}})}((l=n?.nestedEnums)!==null&&l!==void 0?l:t.enums).push(c)}function lZ(e,t,n,r,i){var o,a,s,l;const u={kind:"message",proto:e,deprecated:(a=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&a!==void 0?a:!1,file:t,parent:n,name:e.name,typeName:$I(e,n,t),fields:[],field:{},oneofs:[],members:[],nestedEnums:[],nestedMessages:[],nestedExtensions:[],toString(){return`message ${this.typeName}`}};((s=e.options)===null||s===void 0?void 0:s.mapEntry)===!0?i.add(u):(((l=n?.nestedMessages)!==null&&l!==void 0?l:t.messages).push(u),r.add(u));for(const c of e.enumType)sZ(c,t,u,r);for(const c of e.nestedType)lZ(c,t,u,r,i)}function exe(e,t,n){var r,i;const o={kind:"service",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,file:t,name:e.name,typeName:$I(e,void 0,t),methods:[],method:{},toString(){return`service ${this.typeName}`}};t.services.push(o),n.add(o);for(const a of e.method){const s=txe(a,o,n);o.methods.push(s),o.method[s.localName]=s}}function txe(e,t,n){var r,i,o,a;let s;e.clientStreaming&&e.serverStreaming?s="bidi_streaming":e.clientStreaming?s="client_streaming":e.serverStreaming?s="server_streaming":s="unary";const l=n.getMessage(ec(e.inputType)),u=n.getMessage(ec(e.outputType));ol(l,`invalid MethodDescriptorProto: input_type ${e.inputType} not found`),ol(u,`invalid MethodDescriptorProto: output_type ${e.inputType} not found`);const c=e.name;return{kind:"rpc",proto:e,deprecated:(i=(r=e.options)===null||r===void 0?void 0:r.deprecated)!==null&&i!==void 0?i:!1,parent:t,name:c,localName:O1(c.length?O1(c[0].toLowerCase()+c.substring(1)):c),methodKind:s,input:l,output:u,idempotency:(a=(o=e.options)===null||o===void 0?void 0:o.idempotencyLevel)!==null&&a!==void 0?a:jwe,toString(){return`rpc ${t.typeName}.${c}`}}}function nxe(e,t){return{kind:"oneof",proto:e,deprecated:!1,parent:t,fields:[],name:e.name,localName:O1(mm(e.name)),toString(){return`oneof ${t.typeName}.${this.name}`}}}function IO(e,t,n,r,i){var o,a,s;const l=i===void 0,u={kind:"field",proto:e,deprecated:(a=(o=e.options)===null||o===void 0?void 0:o.deprecated)!==null&&a!==void 0?a:!1,name:e.name,number:e.number,scalar:void 0,message:void 0,enum:void 0,presence:lxe(e,r,l,t),utf8Validation:dxe(e,t),listKind:void 0,mapKind:void 0,mapKey:void 0,delimitedEncoding:void 0,packed:void 0,longAsString:!1,getDefaultValue:void 0};if(l){const d=t.kind=="file"?t:t.file,p=t.kind=="file"?void 0:t,v=$I(e,p,d);u.kind="extension",u.file=d,u.parent=p,u.oneof=void 0,u.typeName=v,u.jsonName=`[${v}]`,u.toString=()=>`extension ${v}`;const y=n.getMessage(ec(e.extendee));ol(y,`invalid FieldDescriptorProto: extendee ${e.extendee} not found`),u.extendee=y}else{const d=t;ol(d.kind=="message"),u.parent=d,u.oneof=r,u.localName=r?mm(e.name):O1(mm(e.name)),u.jsonName=e.jsonName,u.toString=()=>`field ${d.typeName}.${e.name}`}const c=e.label,f=e.type,h=(s=e.options)===null||s===void 0?void 0:s.jstype;if(c===e5){const d=f==Lb?i?.get(ec(e.typeName)):void 0;if(d){u.fieldKind="map";const{key:p,value:v}=cxe(d);return u.mapKey=p.scalar,u.mapKind=v.fieldKind,u.message=v.message,u.delimitedEncoding=!1,u.enum=v.enum,u.scalar=v.scalar,u}switch(u.fieldKind="list",f){case Lb:case N1:u.listKind="message",u.message=n.getMessage(ec(e.typeName)),ol(u.message),u.delimitedEncoding=b8(e,t);break;case v8:u.listKind="enum",u.enum=n.getEnum(ec(e.typeName)),ol(u.enum);break;default:u.listKind="scalar",u.scalar=f,u.longAsString=h==g8;break}return u.packed=uxe(e,t),u}switch(f){case Lb:case N1:u.fieldKind="message",u.message=n.getMessage(ec(e.typeName)),ol(u.message,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),u.delimitedEncoding=b8(e,t),u.getDefaultValue=()=>{};break;case v8:{const d=n.getEnum(ec(e.typeName));ol(d!==void 0,`invalid FieldDescriptorProto: type_name ${e.typeName} not found`),u.fieldKind="enum",u.enum=n.getEnum(ec(e.typeName)),u.getDefaultValue=()=>L1(e,"defaultValue")?Fwe(d,e.defaultValue):void 0;break}default:{u.fieldKind="scalar",u.scalar=f,u.longAsString=h==g8,u.getDefaultValue=()=>L1(e,"defaultValue")?$we(f,e.defaultValue):void 0;break}}return u}function rxe(e){switch(e.syntax){case"":case"proto2":return Uwe;case"proto3":return Gwe;case"editions":if(e.edition===Hwe)return qwe;if(e.edition in aZ)return e.edition;throw new Error(`${e.name}: unsupported edition`);default:throw new Error(`${e.name}: unsupported syntax "${e.syntax}"`)}}function ixe(e,t){return e.dependency.map(n=>{const r=t.getFile(n);if(!r)throw new Error(`Cannot find ${n}, imported by ${e.name}`);return r})}function oxe(e,t){const n=axe(e)+"_";for(const r of t){if(!r.name.toLowerCase().startsWith(n))return;const i=r.name.substring(n.length);if(i.length==0||/^\d/.test(i))return}return n}function axe(e){return(e.substring(0,1)+e.substring(1).replace(/[A-Z]/g,t=>"_"+t)).toLowerCase()}function $I(e,t,n){let r;return t?r=`${t.typeName}.${e.name}`:n.proto.package.length>0?r=`${n.proto.package}.${e.name}`:r=`${e.name}`,r}function ec(e){return e.startsWith(".")?e.substring(1):e}function sxe(e,t){if(!L1(e,"oneofIndex")||e.proto3Optional)return;const n=t[e.oneofIndex];return ol(n,`invalid FieldDescriptorProto: oneof #${e.oneofIndex} for field #${e.number} not found`),n}function lxe(e,t,n,r){if(e.label==Ywe)return Xwe;if(e.label==e5)return m8;if(t||e.proto3Optional||n)return YR;const i=Cp("fieldPresence",{proto:e,parent:r});return i==m8&&(e.type==Lb||e.type==N1)?YR:i}function uxe(e,t){if(e.label!=e5)return!1;switch(e.type){case Wwe:case zwe:case N1:case Lb:return!1}const n=e.options;return n&&L1(n,"packed")?n.packed:Kwe==Cp("repeatedFieldEncoding",{proto:e,parent:t})}function cxe(e){const t=e.fields.find(r=>r.number===1),n=e.fields.find(r=>r.number===2);return ol(t&&t.fieldKind=="scalar"&&t.scalar!=De.BYTES&&t.scalar!=De.FLOAT&&t.scalar!=De.DOUBLE&&n&&n.fieldKind!="list"&&n.fieldKind!="map"),{key:t,value:n}}function fxe(e){var t;return Jwe==Cp("enumType",{proto:e.proto,parent:(t=e.parent)!==null&&t!==void 0?t:e.file})}function b8(e,t){return e.type==N1?!0:Zwe==Cp("messageEncoding",{proto:e,parent:t})}function dxe(e,t){return Qwe==Cp("utf8Validation",{proto:e,parent:t})}function Cp(e,t){var n,r;const i=(n=t.proto.options)===null||n===void 0?void 0:n.features;if(i){const o=i[e];if(o!=0)return o}if("kind"in t){if(t.kind=="message")return Cp(e,(r=t.parent)!==null&&r!==void 0?r:t.file);const o=aZ[t.edition];if(!o)throw new Error(`feature default for edition ${t.edition} not found`);return o[e]}return Cp(e,t.parent)}function ol(e,t){if(!e)throw new Error(t)}function hxe(e){const t=pxe(e);return t.messageType.forEach(qM),oZ(t,()=>{}).getFile(t.name)}function pxe(e){return Object.assign(Object.create({syntax:"",edition:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FileDescriptorProto",dependency:[],publicDependency:[],weakDependency:[],optionDependency:[],service:[],extension:[]},e),{messageType:e.messageType.map(uZ),enumType:e.enumType.map(cZ)}))}function uZ(e){var t,n,r,i,o,a,s,l;return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.DescriptorProto",name:e.name,field:(n=(t=e.field)===null||t===void 0?void 0:t.map(vxe))!==null&&n!==void 0?n:[],extension:[],nestedType:(i=(r=e.nestedType)===null||r===void 0?void 0:r.map(uZ))!==null&&i!==void 0?i:[],enumType:(a=(o=e.enumType)===null||o===void 0?void 0:o.map(cZ))!==null&&a!==void 0?a:[],extensionRange:(l=(s=e.extensionRange)===null||s===void 0?void 0:s.map(c=>Object.assign({$typeName:"google.protobuf.DescriptorProto.ExtensionRange"},c)))!==null&&l!==void 0?l:[],oneofDecl:[],reservedRange:[],reservedName:[]})}function vxe(e){return Object.assign(Object.create({label:1,typeName:"",extendee:"",defaultValue:"",oneofIndex:0,jsonName:"",proto3Optional:!1}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldDescriptorProto"},e),{options:e.options?gxe(e.options):void 0}))}function gxe(e){var t,n,r;return Object.assign(Object.create({ctype:0,packed:!1,jstype:0,lazy:!1,unverifiedLazy:!1,deprecated:!1,weak:!1,debugRedact:!1,retention:0}),Object.assign(Object.assign({$typeName:"google.protobuf.FieldOptions"},e),{targets:(t=e.targets)!==null&&t!==void 0?t:[],editionDefaults:(r=(n=e.editionDefaults)===null||n===void 0?void 0:n.map(o=>Object.assign({$typeName:"google.protobuf.FieldOptions.EditionDefault"},o)))!==null&&r!==void 0?r:[],uninterpretedOption:[]}))}function cZ(e){return Object.assign(Object.create({visibility:0}),{$typeName:"google.protobuf.EnumDescriptorProto",name:e.name,reservedName:[],reservedRange:[],value:e.value.map(n=>Object.assign({$typeName:"google.protobuf.EnumValueDescriptorProto"},n))})}function t5(e){const t=yxe();let n=e.length*3/4;e[e.length-2]=="="?n-=2:e[e.length-1]=="="&&(n-=1);let r=new Uint8Array(n),i=0,o=0,a,s=0;for(let l=0;l>4,s=a,o=2;break;case 2:r[i++]=(s&15)<<4|(a&60)>>2,s=a,o=3;break;case 3:r[i++]=(s&3)<<6|a,o=0;break}}if(o==1)throw Error("invalid base64 string");return r.subarray(0,i)}function mxe(e,t="std"){const n=fZ(t),r=t=="std";let i="",o=0,a,s=0;for(let l=0;l>2],s=(a&3)<<4,o=1;break;case 1:i+=n[s|a>>4],s=(a&15)<<2,o=2;break;case 2:i+=n[s|a>>6],i+=n[a&63],o=0;break}return o&&(i+=n[s],r&&(i+="=",o==1&&(i+="="))),i}let Ow,_8,Iv;function fZ(e){return Ow||(Ow="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),_8=Ow.slice(0,-2).concat("-","_")),e=="url"?_8:Ow}function yxe(){if(!Iv){Iv=[];const e=fZ("std");for(let t=0;tt}}function _xe(e){return e instanceof Error&&bxe.includes(e.name)&&"field"in e&&typeof e.field=="function"}function cd(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function r5(e,t){var n,r,i,o;if(cd(e)&&hc in e&&"add"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const a=t,s=e.field();return a.listKind==s.listKind&&a.scalar===s.scalar&&((n=a.message)===null||n===void 0?void 0:n.typeName)===((r=s.message)===null||r===void 0?void 0:r.typeName)&&((i=a.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function i5(e,t){var n,r,i,o;if(cd(e)&&hc in e&&"has"in e&&"field"in e&&typeof e.field=="function"){if(t!==void 0){const a=t,s=e.field();return a.mapKey===s.mapKey&&a.mapKind==s.mapKind&&a.scalar===s.scalar&&((n=a.message)===null||n===void 0?void 0:n.typeName)===((r=s.message)===null||r===void 0?void 0:r.typeName)&&((i=a.enum)===null||i===void 0?void 0:i.typeName)===((o=s.enum)===null||o===void 0?void 0:o.typeName)}return!0}return!1}function o5(e,t){return cd(e)&&hc in e&&"desc"in e&&cd(e.desc)&&e.desc.kind==="message"&&(t===void 0||e.desc.typeName==t.typeName)}const jR=Symbol.for("@bufbuild/protobuf/text-encoding");function a5(){if(globalThis[jR]==null){const e=new globalThis.TextEncoder,t=new globalThis.TextDecoder;let n;globalThis[jR]={encodeUtf8(r){return e.encode(r)},decodeUtf8(r,i){return i?(n===void 0&&(n=new globalThis.TextDecoder("utf-8",{fatal:!0})),n.decode(r)):t.decode(r)},checkUtf8(r){try{return encodeURIComponent(r),!0}catch{return!1}}}}return globalThis[jR]}var ri;(function(e){e[e.Varint=0]="Varint",e[e.Bit64=1]="Bit64",e[e.LengthDelimited=2]="LengthDelimited",e[e.StartGroup=3]="StartGroup",e[e.EndGroup=4]="EndGroup",e[e.Bit32=5]="Bit32"})(ri||(ri={}));const dZ=34028234663852886e22,hZ=-34028234663852886e22,pZ=4294967295,vZ=2147483647,gZ=-2147483648;class mZ{constructor(t=a5().encodeUtf8){this.encodeUtf8=t,this.stack=[],this.chunks=[],this.buf=[]}finish(){this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]);let t=0;for(let i=0;i>>0)}raw(t){return this.buf.length&&(this.chunks.push(new Uint8Array(this.buf)),this.buf=[]),this.chunks.push(t),this}uint32(t){for(S8(t);t>127;)this.buf.push(t&127|128),t=t>>>7;return this.buf.push(t),this}int32(t){return XR(t),xO(t,this.buf),this}bool(t){return this.buf.push(t?1:0),this}bytes(t){return this.uint32(t.byteLength),this.raw(t)}string(t){let n=this.encodeUtf8(t);return this.uint32(n.byteLength),this.raw(n)}float(t){Sxe(t);let n=new Uint8Array(4);return new DataView(n.buffer).setFloat32(0,t,!0),this.raw(n)}double(t){let n=new Uint8Array(8);return new DataView(n.buffer).setFloat64(0,t,!0),this.raw(n)}fixed32(t){S8(t);let n=new Uint8Array(4);return new DataView(n.buffer).setUint32(0,t,!0),this.raw(n)}sfixed32(t){XR(t);let n=new Uint8Array(4);return new DataView(n.buffer).setInt32(0,t,!0),this.raw(n)}sint32(t){return XR(t),t=(t<<1^t>>31)>>>0,xO(t,this.buf),this}sfixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=kr.enc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}fixed64(t){let n=new Uint8Array(8),r=new DataView(n.buffer),i=kr.uEnc(t);return r.setInt32(0,i.lo,!0),r.setInt32(4,i.hi,!0),this.raw(n)}int64(t){let n=kr.enc(t);return zR(n.lo,n.hi,this.buf),this}sint64(t){const n=kr.enc(t),r=n.hi>>31,i=n.lo<<1^r,o=(n.hi<<1|n.lo>>>31)^r;return zR(i,o,this.buf),this}uint64(t){const n=kr.uEnc(t);return zR(n.lo,n.hi,this.buf),this}}class s5{constructor(t,n=a5().decodeUtf8){this.decodeUtf8=n,this.varint64=Rwe,this.uint32=Dwe,this.buf=t,this.len=t.length,this.pos=0,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength)}tag(){const t=this.pos,n=this.uint32(),r=this.pos-t;if(r>5||r==5&&this.buf[this.pos-1]>15)throw new Error("illegal tag: varint overflows uint32");const i=n>>>3,o=n&7;if(i<=0||o>5)throw new Error("illegal tag: field no "+i+" wire type "+o);return[i,o]}skip(t,n){let r=this.pos;switch(t){case ri.Varint:for(;this.buf[this.pos++]&128;);break;case ri.Bit64:this.pos+=4;case ri.Bit32:this.pos+=4;break;case ri.LengthDelimited:let i=this.uint32();this.pos+=i;break;case ri.StartGroup:for(;;){const[o,a]=this.tag();if(a===ri.EndGroup){if(n!==void 0&&o!==n)throw new Error("invalid end group tag");break}this.skip(a,o)}break;default:throw new Error("cant skip wire type "+t)}return this.assertBounds(),this.buf.subarray(r,this.pos)}assertBounds(){if(this.pos>this.len)throw new RangeError("premature EOF")}int32(){return this.uint32()|0}sint32(){let t=this.uint32();return t>>>1^-(t&1)}int64(){return kr.dec(...this.varint64())}uint64(){return kr.uDec(...this.varint64())}sint64(){let[t,n]=this.varint64(),r=-(t&1);return t=(t>>>1|(n&1)<<31)^r,n=n>>>1^r,kr.dec(t,n)}bool(){let[t,n]=this.varint64();return t!==0||n!==0}fixed32(){return this.view.getUint32((this.pos+=4)-4,!0)}sfixed32(){return this.view.getInt32((this.pos+=4)-4,!0)}fixed64(){return kr.uDec(this.sfixed32(),this.sfixed32())}sfixed64(){return kr.dec(this.sfixed32(),this.sfixed32())}float(){return this.view.getFloat32((this.pos+=4)-4,!0)}double(){return this.view.getFloat64((this.pos+=8)-8,!0)}bytes(){let t=this.uint32(),n=this.pos;return this.pos+=t,this.assertBounds(),this.buf.subarray(n,n+t)}string(t){return this.decodeUtf8(this.bytes(),t)}}function XR(e){if(typeof e=="string")e=Number(e);else if(typeof e!="number")throw new Error("invalid int32: "+typeof e);if(!Number.isInteger(e)||e>vZ||epZ||e<0)throw new Error("invalid uint32: "+e)}function Sxe(e){if(typeof e=="string"){const t=e;if(e=Number(e),Number.isNaN(e)&&t!=="NaN")throw new Error("invalid float32: "+t)}else if(typeof e!="number")throw new Error("invalid float32: "+typeof e);if(Number.isFinite(e)&&(e>dZ||en.number===t):o5(t,e.message)}function yZ(e,t){switch(t){case De.DOUBLE:return typeof e=="number";case De.FLOAT:return typeof e!="number"?!1:Number.isNaN(e)||!Number.isFinite(e)?!0:e>dZ||evZ||epZ||e<0?`${e.toFixed()} out of range`:!0;case De.BOOL:return typeof e=="boolean";case De.STRING:return typeof e!="string"?!1:a5().checkUtf8(e)||"invalid UTF8";case De.BYTES:return e instanceof Uint8Array;case De.INT64:case De.SFIXED64:case De.SINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return kr.parse(e),!0}catch{return`${e} out of range`}return!1;case De.FIXED64:case De.UINT64:if(typeof e=="bigint"||typeof e=="number"||typeof e=="string"&&e.length>0)try{return kr.uParse(e),!0}catch{return`${e} out of range`}return!1}}function XE(e,t,n){return n=typeof n=="string"?`: ${n}`:`, got ${$i(t)}`,e.scalar!==void 0?`expected ${xxe(e.scalar)}`+n:e.enum!==void 0?`expected ${e.enum.toString()}`+n:`expected ${bZ(e.message)}`+n}function $i(e){switch(typeof e){case"object":return e===null?"null":e instanceof Uint8Array?`Uint8Array(${e.length})`:Array.isArray(e)?`Array(${e.length})`:r5(e)?_Z(e.field()):i5(e)?SZ(e.field()):o5(e)?bZ(e.desc):n5(e)?`message ${e.$typeName}`:"object";case"string":return e.length>30?"string":`"${e.split('"').join('\\"')}"`;case"boolean":return String(e);case"number":return String(e);case"bigint":return String(e)+"n";default:return typeof e}}function bZ(e){return`ReflectMessage (${e.typeName})`}function _Z(e){switch(e.listKind){case"message":return`ReflectList (${e.message.toString()})`;case"enum":return`ReflectList (${e.enum.toString()})`;case"scalar":return`ReflectList (${De[e.scalar]})`}}function SZ(e){switch(e.mapKind){case"message":return`ReflectMap (${De[e.mapKey]}, ${e.message.toString()})`;case"enum":return`ReflectMap (${De[e.mapKey]}, ${e.enum.toString()})`;case"scalar":return`ReflectMap (${De[e.mapKey]}, ${De[e.scalar]})`}}function xxe(e){switch(e){case De.STRING:return"string";case De.BOOL:return"boolean";case De.INT64:case De.SINT64:case De.SFIXED64:return"bigint (int64)";case De.UINT64:case De.FIXED64:return"bigint (uint64)";case De.BYTES:return"Uint8Array";case De.DOUBLE:return"number (float64)";case De.FLOAT:return"number (float32)";case De.FIXED32:case De.UINT32:return"number (uint32)";case De.INT32:case De.SFIXED32:case De.SINT32:return"number (int32)"}}function Txe(e){return xZ(e.$typeName)}function dy(e){const t=e.fields[0];return xZ(e.typeName)&&t!==void 0&&t.fieldKind=="scalar"&&t.name=="value"&&t.number==1}function wZ(e){switch(e.typeName){case"google.protobuf.Any":case"google.protobuf.Timestamp":case"google.protobuf.Duration":case"google.protobuf.FieldMask":case"google.protobuf.Struct":case"google.protobuf.Value":case"google.protobuf.ListValue":return!0;default:return dy(e)}}function xZ(e){return e.startsWith("google.protobuf.")&&["DoubleValue","FloatValue","Int64Value","UInt64Value","Int32Value","UInt32Value","BoolValue","StringValue","BytesValue"].includes(e.substring(16))}const Exe=999,Cxe=998,PT=2;function Vs(e,t){if(n5(t,e))return t;const n=Pxe(e);return t!==void 0&&Ixe(e,n,t),n}function Ixe(e,t,n){for(const r of e.members){let i=n[r.localName];if(i==null)continue;let o;if(r.kind=="oneof"){const a=nZ(n,r);if(!a)continue;o=a,i=rZ(n,a)}else o=r;switch(o.fieldKind){case"message":i=u5(o,i);break;case"scalar":i=TZ(o,i);break;case"list":i=Rxe(o,i);break;case"map":i=Axe(o,i);break}iZ(t,o,i)}return t}function TZ(e,t){return e.scalar==De.BYTES?c5(t):t}function Axe(e,t){if(cd(t)){if(e.scalar==De.BYTES)return x8(t,c5);if(e.mapKind=="message")return x8(t,n=>u5(e,n))}return t}function Rxe(e,t){if(Array.isArray(t)){if(e.scalar==De.BYTES)return t.map(c5);if(e.listKind=="message")return t.map(n=>u5(e,n))}return t}function u5(e,t){if(e.fieldKind=="message"&&!e.oneof&&dy(e.message))return TZ(e.message.fields[0],t);if(cd(t)){if(e.message.typeName=="google.protobuf.Struct"&&e.parent.typeName!=="google.protobuf.Value")return t;if(!n5(t,e.message))return Vs(e.message,t)}return t}function c5(e){return Array.isArray(e)?new Uint8Array(e):e}function x8(e,t){const n={};for(const r of Object.entries(e))n[r[0]]=t(r[1]);return n}const kxe=Symbol(),T8=new WeakMap;function Pxe(e){let t;if(Dxe(e)){const n=T8.get(e);let r,i;if(n)({prototype:r,members:i}=n);else{r={},i=new Set;for(const o of e.members)o.kind!="oneof"&&(o.fieldKind!="scalar"&&o.fieldKind!="enum"||o.presence!=PT&&(i.add(o),r[o.localName]=KR(o)));T8.set(e,{prototype:r,members:i})}t=Object.create(r),t.$typeName=e.typeName;for(const o of e.members)i.has(o)||o.kind=="field"&&(o.fieldKind=="message"||(o.fieldKind=="scalar"||o.fieldKind=="enum")&&o.presence!=PT)||(t[o.localName]=KR(o))}else{t={$typeName:e.typeName};for(const n of e.members)(n.kind=="oneof"||n.presence==PT)&&(t[n.localName]=KR(n))}return t}function Dxe(e){switch(e.file.edition){case Exe:return!1;case Cxe:return!0;default:return e.fields.some(t=>t.presence!=PT&&t.fieldKind!="message"&&!t.oneof)}}function KR(e){if(e.kind=="oneof")return{case:void 0};if(e.fieldKind=="list")return[];if(e.fieldKind=="map")return{};if(e.fieldKind=="message")return kxe;const t=e.getDefaultValue();return t!==void 0?e.fieldKind=="scalar"&&e.longAsString?t.toString():t:e.fieldKind=="scalar"?ym(e.scalar,e.longAsString):e.enum.values[0].number}function xl(e,t,n=!0){return new EZ(e,t,n)}const E8=new WeakMap;class EZ{get sortedFields(){const t=E8.get(this.desc);if(t)return t;const n=this.desc.fields.concat().sort((r,i)=>r.number-i.number);return E8.set(this.desc,n),n}constructor(t,n,r=!0){this.lists=new Map,this.maps=new Map,this.check=r,this.desc=t,this.message=this[hc]=n??Vs(t),this.fields=t.fields,this.oneofs=t.oneofs,this.members=t.members}findNumber(t){return this._fieldsByNumber||(this._fieldsByNumber=new Map(this.desc.fields.map(n=>[n.number,n]))),this._fieldsByNumber.get(t)}oneofCase(t){return c0(this.message,t),nZ(this.message,t)}isSet(t){return c0(this.message,t),Nwe(this.message,t)}clear(t){c0(this.message,t),Mwe(this.message,t)}get(t){c0(this.message,t);const n=rZ(this.message,t);switch(t.fieldKind){case"list":let r=this.lists.get(t);return(!r||r[hc]!==n)&&this.lists.set(t,r=new Oxe(t,n,this.check)),r;case"map":let i=this.maps.get(t);return(!i||i[hc]!==n)&&this.maps.set(t,i=new Lxe(t,n,this.check)),i;case"message":return d5(t,n,this.check);case"scalar":return n===void 0?ym(t.scalar,!1):h5(t,n);case"enum":return n??t.enum.values[0].number}}set(t,n){if(c0(this.message,t),this.check){const i=Ih(t,n);if(i)throw i}let r;t.fieldKind=="message"?r=f5(t,n):i5(n)||r5(n)?r=n[hc]:r=p5(t,n),iZ(this.message,t,r)}getUnknown(){return this.message.$unknown}setUnknown(t){this.message.$unknown=t}}function c0(e,t){if(t.parent.typeName!==e.$typeName)throw new Qa(t,`cannot use ${t.toString()} with message ${e.$typeName}`,"ForeignFieldError")}class Oxe{field(){return this._field}get size(){return this._arr.length}constructor(t,n,r){this._field=t,this._arr=this[hc]=n,this.check=r}get(t){const n=this._arr[t];return n===void 0?void 0:ZR(this._field,n,this.check)}set(t,n){if(t<0||t>=this._arr.length)throw new Qa(this._field,`list item #${t+1}: out of range`);if(this.check){const r=w8(this._field,t,n);if(r)throw r}this._arr[t]=C8(this._field,n)}add(t){if(this.check){const n=w8(this._field,this._arr.length,t);if(n)throw n}this._arr.push(C8(this._field,t))}clear(){this._arr.splice(0,this._arr.length)}[Symbol.iterator](){return this.values()}keys(){return this._arr.keys()}*values(){for(const t of this._arr)yield ZR(this._field,t,this.check)}*entries(){for(let t=0;tr.nestedMessages[i],e.messages[t])}const Uxe=hxe({name:"google/protobuf/descriptor.proto",package:"google.protobuf",messageType:[{name:"FileDescriptorSet",field:[{name:"file",number:1,type:11,label:3,typeName:".google.protobuf.FileDescriptorProto"}],extensionRange:[{start:536e6,end:536000001}]},{name:"FileDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"package",number:2,type:9,label:1},{name:"dependency",number:3,type:9,label:3},{name:"public_dependency",number:10,type:5,label:3},{name:"weak_dependency",number:11,type:5,label:3},{name:"option_dependency",number:15,type:9,label:3},{name:"message_type",number:4,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:5,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"service",number:6,type:11,label:3,typeName:".google.protobuf.ServiceDescriptorProto"},{name:"extension",number:7,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FileOptions"},{name:"source_code_info",number:9,type:11,label:1,typeName:".google.protobuf.SourceCodeInfo"},{name:"syntax",number:12,type:9,label:1},{name:"edition",number:14,type:14,label:1,typeName:".google.protobuf.Edition"}]},{name:"DescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"field",number:2,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"extension",number:6,type:11,label:3,typeName:".google.protobuf.FieldDescriptorProto"},{name:"nested_type",number:3,type:11,label:3,typeName:".google.protobuf.DescriptorProto"},{name:"enum_type",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto"},{name:"extension_range",number:5,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ExtensionRange"},{name:"oneof_decl",number:8,type:11,label:3,typeName:".google.protobuf.OneofDescriptorProto"},{name:"options",number:7,type:11,label:1,typeName:".google.protobuf.MessageOptions"},{name:"reserved_range",number:9,type:11,label:3,typeName:".google.protobuf.DescriptorProto.ReservedRange"},{name:"reserved_name",number:10,type:9,label:3},{name:"visibility",number:11,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"ExtensionRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ExtensionRangeOptions"}]},{name:"ReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"ExtensionRangeOptions",field:[{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"},{name:"declaration",number:2,type:11,label:3,typeName:".google.protobuf.ExtensionRangeOptions.Declaration",options:{retention:2}},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"verification",number:3,type:14,label:1,typeName:".google.protobuf.ExtensionRangeOptions.VerificationState",defaultValue:"UNVERIFIED",options:{retention:2}}],nestedType:[{name:"Declaration",field:[{name:"number",number:1,type:5,label:1},{name:"full_name",number:2,type:9,label:1},{name:"type",number:3,type:9,label:1},{name:"reserved",number:5,type:8,label:1},{name:"repeated",number:6,type:8,label:1}]}],enumType:[{name:"VerificationState",value:[{name:"DECLARATION",number:0},{name:"UNVERIFIED",number:1}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:3,type:5,label:1},{name:"label",number:4,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Label"},{name:"type",number:5,type:14,label:1,typeName:".google.protobuf.FieldDescriptorProto.Type"},{name:"type_name",number:6,type:9,label:1},{name:"extendee",number:2,type:9,label:1},{name:"default_value",number:7,type:9,label:1},{name:"oneof_index",number:9,type:5,label:1},{name:"json_name",number:10,type:9,label:1},{name:"options",number:8,type:11,label:1,typeName:".google.protobuf.FieldOptions"},{name:"proto3_optional",number:17,type:8,label:1}],enumType:[{name:"Type",value:[{name:"TYPE_DOUBLE",number:1},{name:"TYPE_FLOAT",number:2},{name:"TYPE_INT64",number:3},{name:"TYPE_UINT64",number:4},{name:"TYPE_INT32",number:5},{name:"TYPE_FIXED64",number:6},{name:"TYPE_FIXED32",number:7},{name:"TYPE_BOOL",number:8},{name:"TYPE_STRING",number:9},{name:"TYPE_GROUP",number:10},{name:"TYPE_MESSAGE",number:11},{name:"TYPE_BYTES",number:12},{name:"TYPE_UINT32",number:13},{name:"TYPE_ENUM",number:14},{name:"TYPE_SFIXED32",number:15},{name:"TYPE_SFIXED64",number:16},{name:"TYPE_SINT32",number:17},{name:"TYPE_SINT64",number:18}]},{name:"Label",value:[{name:"LABEL_OPTIONAL",number:1},{name:"LABEL_REPEATED",number:3},{name:"LABEL_REQUIRED",number:2}]}]},{name:"OneofDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"options",number:2,type:11,label:1,typeName:".google.protobuf.OneofOptions"}]},{name:"EnumDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"value",number:2,type:11,label:3,typeName:".google.protobuf.EnumValueDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumOptions"},{name:"reserved_range",number:4,type:11,label:3,typeName:".google.protobuf.EnumDescriptorProto.EnumReservedRange"},{name:"reserved_name",number:5,type:9,label:3},{name:"visibility",number:6,type:14,label:1,typeName:".google.protobuf.SymbolVisibility"}],nestedType:[{name:"EnumReservedRange",field:[{name:"start",number:1,type:5,label:1},{name:"end",number:2,type:5,label:1}]}]},{name:"EnumValueDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"number",number:2,type:5,label:1},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.EnumValueOptions"}]},{name:"ServiceDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"method",number:2,type:11,label:3,typeName:".google.protobuf.MethodDescriptorProto"},{name:"options",number:3,type:11,label:1,typeName:".google.protobuf.ServiceOptions"}]},{name:"MethodDescriptorProto",field:[{name:"name",number:1,type:9,label:1},{name:"input_type",number:2,type:9,label:1},{name:"output_type",number:3,type:9,label:1},{name:"options",number:4,type:11,label:1,typeName:".google.protobuf.MethodOptions"},{name:"client_streaming",number:5,type:8,label:1,defaultValue:"false"},{name:"server_streaming",number:6,type:8,label:1,defaultValue:"false"}]},{name:"FileOptions",field:[{name:"java_package",number:1,type:9,label:1},{name:"java_outer_classname",number:8,type:9,label:1},{name:"java_multiple_files",number:10,type:8,label:1,defaultValue:"false",options:{}},{name:"java_generate_equals_and_hash",number:20,type:8,label:1,options:{deprecated:!0}},{name:"java_string_check_utf8",number:27,type:8,label:1,defaultValue:"false"},{name:"optimize_for",number:9,type:14,label:1,typeName:".google.protobuf.FileOptions.OptimizeMode",defaultValue:"SPEED"},{name:"go_package",number:11,type:9,label:1},{name:"cc_generic_services",number:16,type:8,label:1,defaultValue:"false"},{name:"java_generic_services",number:17,type:8,label:1,defaultValue:"false"},{name:"py_generic_services",number:18,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:23,type:8,label:1,defaultValue:"false"},{name:"cc_enable_arenas",number:31,type:8,label:1,defaultValue:"true"},{name:"objc_class_prefix",number:36,type:9,label:1},{name:"csharp_namespace",number:37,type:9,label:1},{name:"swift_prefix",number:39,type:9,label:1},{name:"php_class_prefix",number:40,type:9,label:1},{name:"php_namespace",number:41,type:9,label:1},{name:"php_metadata_namespace",number:44,type:9,label:1},{name:"ruby_package",number:45,type:9,label:1},{name:"features",number:50,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"OptimizeMode",value:[{name:"SPEED",number:1},{name:"CODE_SIZE",number:2},{name:"LITE_RUNTIME",number:3}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"MessageOptions",field:[{name:"message_set_wire_format",number:1,type:8,label:1,defaultValue:"false"},{name:"no_standard_descriptor_accessor",number:2,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"map_entry",number:7,type:8,label:1},{name:"deprecated_legacy_json_field_conflicts",number:11,type:8,label:1,options:{deprecated:!0}},{name:"features",number:12,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"FieldOptions",field:[{name:"ctype",number:1,type:14,label:1,typeName:".google.protobuf.FieldOptions.CType",defaultValue:"STRING"},{name:"packed",number:2,type:8,label:1},{name:"jstype",number:6,type:14,label:1,typeName:".google.protobuf.FieldOptions.JSType",defaultValue:"JS_NORMAL"},{name:"lazy",number:5,type:8,label:1,defaultValue:"false"},{name:"unverified_lazy",number:15,type:8,label:1,defaultValue:"false"},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"weak",number:10,type:8,label:1,defaultValue:"false",options:{deprecated:!0}},{name:"debug_redact",number:16,type:8,label:1,defaultValue:"false"},{name:"retention",number:17,type:14,label:1,typeName:".google.protobuf.FieldOptions.OptionRetention"},{name:"targets",number:19,type:14,label:3,typeName:".google.protobuf.FieldOptions.OptionTargetType"},{name:"edition_defaults",number:20,type:11,label:3,typeName:".google.protobuf.FieldOptions.EditionDefault"},{name:"features",number:21,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"feature_support",number:22,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],nestedType:[{name:"EditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"value",number:2,type:9,label:1}]},{name:"FeatureSupport",field:[{name:"edition_introduced",number:1,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"edition_deprecated",number:2,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"deprecation_warning",number:3,type:9,label:1},{name:"edition_removed",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"removal_error",number:5,type:9,label:1}]}],enumType:[{name:"CType",value:[{name:"STRING",number:0},{name:"CORD",number:1},{name:"STRING_PIECE",number:2}]},{name:"JSType",value:[{name:"JS_NORMAL",number:0},{name:"JS_STRING",number:1},{name:"JS_NUMBER",number:2}]},{name:"OptionRetention",value:[{name:"RETENTION_UNKNOWN",number:0},{name:"RETENTION_RUNTIME",number:1},{name:"RETENTION_SOURCE",number:2}]},{name:"OptionTargetType",value:[{name:"TARGET_TYPE_UNKNOWN",number:0},{name:"TARGET_TYPE_FILE",number:1},{name:"TARGET_TYPE_EXTENSION_RANGE",number:2},{name:"TARGET_TYPE_MESSAGE",number:3},{name:"TARGET_TYPE_FIELD",number:4},{name:"TARGET_TYPE_ONEOF",number:5},{name:"TARGET_TYPE_ENUM",number:6},{name:"TARGET_TYPE_ENUM_ENTRY",number:7},{name:"TARGET_TYPE_SERVICE",number:8},{name:"TARGET_TYPE_METHOD",number:9}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"OneofOptions",field:[{name:"features",number:1,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumOptions",field:[{name:"allow_alias",number:2,type:8,label:1},{name:"deprecated",number:3,type:8,label:1,defaultValue:"false"},{name:"deprecated_legacy_json_field_conflicts",number:6,type:8,label:1,options:{deprecated:!0}},{name:"features",number:7,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"EnumValueOptions",field:[{name:"deprecated",number:1,type:8,label:1,defaultValue:"false"},{name:"features",number:2,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"debug_redact",number:3,type:8,label:1,defaultValue:"false"},{name:"feature_support",number:4,type:11,label:1,typeName:".google.protobuf.FieldOptions.FeatureSupport"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"ServiceOptions",field:[{name:"features",number:34,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],extensionRange:[{start:1e3,end:536870912}]},{name:"MethodOptions",field:[{name:"deprecated",number:33,type:8,label:1,defaultValue:"false"},{name:"idempotency_level",number:34,type:14,label:1,typeName:".google.protobuf.MethodOptions.IdempotencyLevel",defaultValue:"IDEMPOTENCY_UNKNOWN"},{name:"features",number:35,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"uninterpreted_option",number:999,type:11,label:3,typeName:".google.protobuf.UninterpretedOption"}],enumType:[{name:"IdempotencyLevel",value:[{name:"IDEMPOTENCY_UNKNOWN",number:0},{name:"NO_SIDE_EFFECTS",number:1},{name:"IDEMPOTENT",number:2}]}],extensionRange:[{start:1e3,end:536870912}]},{name:"UninterpretedOption",field:[{name:"name",number:2,type:11,label:3,typeName:".google.protobuf.UninterpretedOption.NamePart"},{name:"identifier_value",number:3,type:9,label:1},{name:"positive_int_value",number:4,type:4,label:1},{name:"negative_int_value",number:5,type:3,label:1},{name:"double_value",number:6,type:1,label:1},{name:"string_value",number:7,type:12,label:1},{name:"aggregate_value",number:8,type:9,label:1}],nestedType:[{name:"NamePart",field:[{name:"name_part",number:1,type:9,label:2},{name:"is_extension",number:2,type:8,label:2}]}]},{name:"FeatureSet",field:[{name:"field_presence",number:1,type:14,label:1,typeName:".google.protobuf.FeatureSet.FieldPresence",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPLICIT",edition:900},{value:"IMPLICIT",edition:999},{value:"EXPLICIT",edition:1e3}]}},{name:"enum_type",number:2,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnumType",options:{retention:1,targets:[6,1],editionDefaults:[{value:"CLOSED",edition:900},{value:"OPEN",edition:999}]}},{name:"repeated_field_encoding",number:3,type:14,label:1,typeName:".google.protobuf.FeatureSet.RepeatedFieldEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"EXPANDED",edition:900},{value:"PACKED",edition:999}]}},{name:"utf8_validation",number:4,type:14,label:1,typeName:".google.protobuf.FeatureSet.Utf8Validation",options:{retention:1,targets:[4,1],editionDefaults:[{value:"NONE",edition:900},{value:"VERIFY",edition:999}]}},{name:"message_encoding",number:5,type:14,label:1,typeName:".google.protobuf.FeatureSet.MessageEncoding",options:{retention:1,targets:[4,1],editionDefaults:[{value:"LENGTH_PREFIXED",edition:900}]}},{name:"json_format",number:6,type:14,label:1,typeName:".google.protobuf.FeatureSet.JsonFormat",options:{retention:1,targets:[3,6,1],editionDefaults:[{value:"LEGACY_BEST_EFFORT",edition:900},{value:"ALLOW",edition:999}]}},{name:"enforce_naming_style",number:7,type:14,label:1,typeName:".google.protobuf.FeatureSet.EnforceNamingStyle",options:{retention:2,targets:[1,2,3,4,5,6,7,8,9],editionDefaults:[{value:"STYLE_LEGACY",edition:900},{value:"STYLE2024",edition:1001}]}},{name:"default_symbol_visibility",number:8,type:14,label:1,typeName:".google.protobuf.FeatureSet.VisibilityFeature.DefaultSymbolVisibility",options:{retention:2,targets:[1],editionDefaults:[{value:"EXPORT_ALL",edition:900},{value:"EXPORT_TOP_LEVEL",edition:1001}]}}],nestedType:[{name:"VisibilityFeature",enumType:[{name:"DefaultSymbolVisibility",value:[{name:"DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",number:0},{name:"EXPORT_ALL",number:1},{name:"EXPORT_TOP_LEVEL",number:2},{name:"LOCAL_ALL",number:3},{name:"STRICT",number:4}]}]}],enumType:[{name:"FieldPresence",value:[{name:"FIELD_PRESENCE_UNKNOWN",number:0},{name:"EXPLICIT",number:1},{name:"IMPLICIT",number:2},{name:"LEGACY_REQUIRED",number:3}]},{name:"EnumType",value:[{name:"ENUM_TYPE_UNKNOWN",number:0},{name:"OPEN",number:1},{name:"CLOSED",number:2}]},{name:"RepeatedFieldEncoding",value:[{name:"REPEATED_FIELD_ENCODING_UNKNOWN",number:0},{name:"PACKED",number:1},{name:"EXPANDED",number:2}]},{name:"Utf8Validation",value:[{name:"UTF8_VALIDATION_UNKNOWN",number:0},{name:"VERIFY",number:2},{name:"NONE",number:3}]},{name:"MessageEncoding",value:[{name:"MESSAGE_ENCODING_UNKNOWN",number:0},{name:"LENGTH_PREFIXED",number:1},{name:"DELIMITED",number:2}]},{name:"JsonFormat",value:[{name:"JSON_FORMAT_UNKNOWN",number:0},{name:"ALLOW",number:1},{name:"LEGACY_BEST_EFFORT",number:2}]},{name:"EnforceNamingStyle",value:[{name:"ENFORCE_NAMING_STYLE_UNKNOWN",number:0},{name:"STYLE2024",number:1},{name:"STYLE_LEGACY",number:2}]}],extensionRange:[{start:1e3,end:9995},{start:9995,end:1e4},{start:1e4,end:10001}]},{name:"FeatureSetDefaults",field:[{name:"defaults",number:1,type:11,label:3,typeName:".google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault"},{name:"minimum_edition",number:4,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"maximum_edition",number:5,type:14,label:1,typeName:".google.protobuf.Edition"}],nestedType:[{name:"FeatureSetEditionDefault",field:[{name:"edition",number:3,type:14,label:1,typeName:".google.protobuf.Edition"},{name:"overridable_features",number:4,type:11,label:1,typeName:".google.protobuf.FeatureSet"},{name:"fixed_features",number:5,type:11,label:1,typeName:".google.protobuf.FeatureSet"}]}]},{name:"SourceCodeInfo",field:[{name:"location",number:1,type:11,label:3,typeName:".google.protobuf.SourceCodeInfo.Location"}],nestedType:[{name:"Location",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"span",number:2,type:5,label:3,options:{packed:!0}},{name:"leading_comments",number:3,type:9,label:1},{name:"trailing_comments",number:4,type:9,label:1},{name:"leading_detached_comments",number:6,type:9,label:3}]}],extensionRange:[{start:536e6,end:536000001}]},{name:"GeneratedCodeInfo",field:[{name:"annotation",number:1,type:11,label:3,typeName:".google.protobuf.GeneratedCodeInfo.Annotation"}],nestedType:[{name:"Annotation",field:[{name:"path",number:1,type:5,label:3,options:{packed:!0}},{name:"source_file",number:2,type:9,label:1},{name:"begin",number:3,type:5,label:1},{name:"end",number:4,type:5,label:1},{name:"semantic",number:5,type:14,label:1,typeName:".google.protobuf.GeneratedCodeInfo.Annotation.Semantic"}],enumType:[{name:"Semantic",value:[{name:"NONE",number:0},{name:"SET",number:1},{name:"ALIAS",number:2}]}]}]}],enumType:[{name:"Edition",value:[{name:"EDITION_UNKNOWN",number:0},{name:"EDITION_LEGACY",number:900},{name:"EDITION_PROTO2",number:998},{name:"EDITION_PROTO3",number:999},{name:"EDITION_2023",number:1e3},{name:"EDITION_2024",number:1001},{name:"EDITION_UNSTABLE",number:9999},{name:"EDITION_1_TEST_ONLY",number:1},{name:"EDITION_2_TEST_ONLY",number:2},{name:"EDITION_99997_TEST_ONLY",number:99997},{name:"EDITION_99998_TEST_ONLY",number:99998},{name:"EDITION_99999_TEST_ONLY",number:99999},{name:"EDITION_MAX",number:2147483647}]},{name:"SymbolVisibility",value:[{name:"VISIBILITY_UNSET",number:0},{name:"VISIBILITY_LOCAL",number:1},{name:"VISIBILITY_EXPORT",number:2}]}]}),Gxe=Pu(Uxe,1);var R8;(function(e){e[e.DECLARATION=0]="DECLARATION",e[e.UNVERIFIED=1]="UNVERIFIED"})(R8||(R8={}));var k8;(function(e){e[e.DOUBLE=1]="DOUBLE",e[e.FLOAT=2]="FLOAT",e[e.INT64=3]="INT64",e[e.UINT64=4]="UINT64",e[e.INT32=5]="INT32",e[e.FIXED64=6]="FIXED64",e[e.FIXED32=7]="FIXED32",e[e.BOOL=8]="BOOL",e[e.STRING=9]="STRING",e[e.GROUP=10]="GROUP",e[e.MESSAGE=11]="MESSAGE",e[e.BYTES=12]="BYTES",e[e.UINT32=13]="UINT32",e[e.ENUM=14]="ENUM",e[e.SFIXED32=15]="SFIXED32",e[e.SFIXED64=16]="SFIXED64",e[e.SINT32=17]="SINT32",e[e.SINT64=18]="SINT64"})(k8||(k8={}));var P8;(function(e){e[e.OPTIONAL=1]="OPTIONAL",e[e.REPEATED=3]="REPEATED",e[e.REQUIRED=2]="REQUIRED"})(P8||(P8={}));var D8;(function(e){e[e.SPEED=1]="SPEED",e[e.CODE_SIZE=2]="CODE_SIZE",e[e.LITE_RUNTIME=3]="LITE_RUNTIME"})(D8||(D8={}));var O8;(function(e){e[e.STRING=0]="STRING",e[e.CORD=1]="CORD",e[e.STRING_PIECE=2]="STRING_PIECE"})(O8||(O8={}));var L8;(function(e){e[e.JS_NORMAL=0]="JS_NORMAL",e[e.JS_STRING=1]="JS_STRING",e[e.JS_NUMBER=2]="JS_NUMBER"})(L8||(L8={}));var N8;(function(e){e[e.RETENTION_UNKNOWN=0]="RETENTION_UNKNOWN",e[e.RETENTION_RUNTIME=1]="RETENTION_RUNTIME",e[e.RETENTION_SOURCE=2]="RETENTION_SOURCE"})(N8||(N8={}));var M8;(function(e){e[e.TARGET_TYPE_UNKNOWN=0]="TARGET_TYPE_UNKNOWN",e[e.TARGET_TYPE_FILE=1]="TARGET_TYPE_FILE",e[e.TARGET_TYPE_EXTENSION_RANGE=2]="TARGET_TYPE_EXTENSION_RANGE",e[e.TARGET_TYPE_MESSAGE=3]="TARGET_TYPE_MESSAGE",e[e.TARGET_TYPE_FIELD=4]="TARGET_TYPE_FIELD",e[e.TARGET_TYPE_ONEOF=5]="TARGET_TYPE_ONEOF",e[e.TARGET_TYPE_ENUM=6]="TARGET_TYPE_ENUM",e[e.TARGET_TYPE_ENUM_ENTRY=7]="TARGET_TYPE_ENUM_ENTRY",e[e.TARGET_TYPE_SERVICE=8]="TARGET_TYPE_SERVICE",e[e.TARGET_TYPE_METHOD=9]="TARGET_TYPE_METHOD"})(M8||(M8={}));var F8;(function(e){e[e.IDEMPOTENCY_UNKNOWN=0]="IDEMPOTENCY_UNKNOWN",e[e.NO_SIDE_EFFECTS=1]="NO_SIDE_EFFECTS",e[e.IDEMPOTENT=2]="IDEMPOTENT"})(F8||(F8={}));var $8;(function(e){e[e.DEFAULT_SYMBOL_VISIBILITY_UNKNOWN=0]="DEFAULT_SYMBOL_VISIBILITY_UNKNOWN",e[e.EXPORT_ALL=1]="EXPORT_ALL",e[e.EXPORT_TOP_LEVEL=2]="EXPORT_TOP_LEVEL",e[e.LOCAL_ALL=3]="LOCAL_ALL",e[e.STRICT=4]="STRICT"})($8||($8={}));var B8;(function(e){e[e.FIELD_PRESENCE_UNKNOWN=0]="FIELD_PRESENCE_UNKNOWN",e[e.EXPLICIT=1]="EXPLICIT",e[e.IMPLICIT=2]="IMPLICIT",e[e.LEGACY_REQUIRED=3]="LEGACY_REQUIRED"})(B8||(B8={}));var V8;(function(e){e[e.ENUM_TYPE_UNKNOWN=0]="ENUM_TYPE_UNKNOWN",e[e.OPEN=1]="OPEN",e[e.CLOSED=2]="CLOSED"})(V8||(V8={}));var U8;(function(e){e[e.REPEATED_FIELD_ENCODING_UNKNOWN=0]="REPEATED_FIELD_ENCODING_UNKNOWN",e[e.PACKED=1]="PACKED",e[e.EXPANDED=2]="EXPANDED"})(U8||(U8={}));var G8;(function(e){e[e.UTF8_VALIDATION_UNKNOWN=0]="UTF8_VALIDATION_UNKNOWN",e[e.VERIFY=2]="VERIFY",e[e.NONE=3]="NONE"})(G8||(G8={}));var H8;(function(e){e[e.MESSAGE_ENCODING_UNKNOWN=0]="MESSAGE_ENCODING_UNKNOWN",e[e.LENGTH_PREFIXED=1]="LENGTH_PREFIXED",e[e.DELIMITED=2]="DELIMITED"})(H8||(H8={}));var W8;(function(e){e[e.JSON_FORMAT_UNKNOWN=0]="JSON_FORMAT_UNKNOWN",e[e.ALLOW=1]="ALLOW",e[e.LEGACY_BEST_EFFORT=2]="LEGACY_BEST_EFFORT"})(W8||(W8={}));var z8;(function(e){e[e.ENFORCE_NAMING_STYLE_UNKNOWN=0]="ENFORCE_NAMING_STYLE_UNKNOWN",e[e.STYLE2024=1]="STYLE2024",e[e.STYLE_LEGACY=2]="STYLE_LEGACY"})(z8||(z8={}));var Y8;(function(e){e[e.NONE=0]="NONE",e[e.SET=1]="SET",e[e.ALIAS=2]="ALIAS"})(Y8||(Y8={}));var j8;(function(e){e[e.EDITION_UNKNOWN=0]="EDITION_UNKNOWN",e[e.EDITION_LEGACY=900]="EDITION_LEGACY",e[e.EDITION_PROTO2=998]="EDITION_PROTO2",e[e.EDITION_PROTO3=999]="EDITION_PROTO3",e[e.EDITION_2023=1e3]="EDITION_2023",e[e.EDITION_2024=1001]="EDITION_2024",e[e.EDITION_UNSTABLE=9999]="EDITION_UNSTABLE",e[e.EDITION_1_TEST_ONLY=1]="EDITION_1_TEST_ONLY",e[e.EDITION_2_TEST_ONLY=2]="EDITION_2_TEST_ONLY",e[e.EDITION_99997_TEST_ONLY=99997]="EDITION_99997_TEST_ONLY",e[e.EDITION_99998_TEST_ONLY=99998]="EDITION_99998_TEST_ONLY",e[e.EDITION_99999_TEST_ONLY=99999]="EDITION_99999_TEST_ONLY",e[e.EDITION_MAX=2147483647]="EDITION_MAX"})(j8||(j8={}));var X8;(function(e){e[e.VISIBILITY_UNSET=0]="VISIBILITY_UNSET",e[e.VISIBILITY_LOCAL=1]="VISIBILITY_LOCAL",e[e.VISIBILITY_EXPORT=2]="VISIBILITY_EXPORT"})(X8||(X8={}));const K8={readUnknownFields:!0};function Hxe(e){return e?Object.assign(Object.assign({},K8),e):K8}function hy(e,t,n){const r=xl(e,void 0,!1);return OZ(r,new s5(t),Hxe(n),!1,t.byteLength),r.message}function OZ(e,t,n,r,i){var o;const a=r?t.len:t.pos+i;let s,l;const u=(o=e.getUnknown())!==null&&o!==void 0?o:[];for(;t.pos0&&e.setUnknown(u)}function LZ(e,t,n,r,i){var o;switch(n.fieldKind){case"scalar":e.set(n,bm(t,n.scalar,n.utf8Validation));break;case"enum":const a=bm(t,De.INT32);if(n.enum.open)e.set(n,a);else if(n.enum.values.some(l=>l.number===a))e.set(n,a);else if(i.readUnknownFields){const l=[];xO(a,l);const u=(o=e.getUnknown())!==null&&o!==void 0?o:[];u.push({no:n.number,wireType:r,data:new Uint8Array(l)}),e.setUnknown(u)}break;case"message":e.set(n,g5(t,i,n,e.get(n)));break;case"list":zxe(t,r,e.get(n),i);break;case"map":Wxe(t,e.get(n),i);break}}function Wxe(e,t,n){const r=t.field();let i,o;const a=e.uint32(),s=e.pos+a;for(;e.poso.proto.name))!==null&&n!==void 0?n:[],oZ(r,o=>t?.find(a=>a.proto.name===o)).getFile(r.name)}function Yxe(e,t,...n){if(n.length>0)throw new Error;return e.services[t]}const NZ=q_("Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYiJgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnYKE2NvbS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaLGdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2FueXBiogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),jxe=Pu(NZ,0);function Xxe(e,t,n){let r=!1;return n||(n=Vs(jxe),r=!0),n.value=v5(e,t),n.typeUrl=Jxe(t.$typeName),r?n:void 0}function Kxe(e,t){if(e.typeUrl==="")return!1;const n=typeof t=="string"?t:t.typeName,r=MZ(e.typeUrl);return n===r}function Zxe(e,t){if(e.typeUrl==="")return;const n=t.kind=="message"?t:t.getMessage(MZ(e.typeUrl));if(!(!n||!Kxe(e,n)))return hy(n,e.value)}function Jxe(e){return`type.googleapis.com/${e}`}function MZ(e){const t=e.lastIndexOf("/"),n=t>=0?e.substring(t+1):e;if(!n.length)throw new Error(`invalid type url: ${e}`);return n}const Qxe=q_("Chtnb29nbGUvcHJvdG9idWYvZW1wdHkucHJvdG8SD2dvb2dsZS5wcm90b2J1ZiIHCgVFbXB0eUJ9ChNjb20uZ29vZ2xlLnByb3RvYnVmQgpFbXB0eVByb3RvUAFaLmdvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL2VtcHR5cGL4AQGiAgNHUEKqAh5Hb29nbGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw"),m5=q_("Chxnb29nbGUvcHJvdG9idWYvc3RydWN0LnByb3RvEg9nb29nbGUucHJvdG9idWYihAEKBlN0cnVjdBIzCgZmaWVsZHMYASADKAsyIy5nb29nbGUucHJvdG9idWYuU3RydWN0LkZpZWxkc0VudHJ5GkUKC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIlCgV2YWx1ZRgCIAEoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZToCOAEi6gEKBVZhbHVlEjAKCm51bGxfdmFsdWUYASABKA4yGi5nb29nbGUucHJvdG9idWYuTnVsbFZhbHVlSAASFgoMbnVtYmVyX3ZhbHVlGAIgASgBSAASFgoMc3RyaW5nX3ZhbHVlGAMgASgJSAASFAoKYm9vbF92YWx1ZRgEIAEoCEgAEi8KDHN0cnVjdF92YWx1ZRgFIAEoCzIXLmdvb2dsZS5wcm90b2J1Zi5TdHJ1Y3RIABIwCgpsaXN0X3ZhbHVlGAYgASgLMhouZ29vZ2xlLnByb3RvYnVmLkxpc3RWYWx1ZUgAQgYKBGtpbmQiMwoJTGlzdFZhbHVlEiYKBnZhbHVlcxgBIAMoCzIWLmdvb2dsZS5wcm90b2J1Zi5WYWx1ZSobCglOdWxsVmFsdWUSDgoKTlVMTF9WQUxVRRAAQn8KE2NvbS5nb29nbGUucHJvdG9idWZCC1N0cnVjdFByb3RvUAFaL2dvb2dsZS5nb2xhbmcub3JnL3Byb3RvYnVmL3R5cGVzL2tub3duL3N0cnVjdHBi+AEBogIDR1BCqgIeR29vZ2xlLlByb3RvYnVmLldlbGxLbm93blR5cGVzYgZwcm90bzM"),qxe=Pu(m5,0),FZ=Pu(m5,1),eTe=Pu(m5,2);var AO;(function(e){e[e.NULL_VALUE=0]="NULL_VALUE"})(AO||(AO={}));const eS=q_("ChxkYWVtb24vc3RhcnRlZF9zZXJ2aWNlLnByb3RvEgZkYWVtb24iLgoHVmVyc2lvbhIPCgd2ZXJzaW9uGAEgASgJEhIKCmFwaVZlcnNpb24YAiABKAUilwEKDVNlcnZpY2VTdGF0dXMSKgoGc3RhdHVzGAEgASgOMhouZGFlbW9uLlNlcnZpY2VTdGF0dXMuVHlwZRIUCgxlcnJvck1lc3NhZ2UYAiABKAkiRAoEVHlwZRIICgRJRExFEAASDAoIU1RBUlRJTkcQARILCgdTVEFSVEVEEAISDAoIU1RPUFBJTkcQAxIJCgVGQVRBTBAEIioKFlN1YnNjcmliZVN0YXR1c1JlcXVlc3QSEAoIaW50ZXJ2YWwYASABKAMieAoDTG9nEiUKCG1lc3NhZ2VzGAEgAygLMhMuZGFlbW9uLkxvZy5NZXNzYWdlEg0KBXJlc2V0GAIgASgIGjsKB01lc3NhZ2USHwoFbGV2ZWwYASABKA4yEC5kYWVtb24uTG9nTGV2ZWwSDwoHbWVzc2FnZRgCIAEoCSIyCg9EZWZhdWx0TG9nTGV2ZWwSHwoFbGV2ZWwYASABKA4yEC5kYWVtb24uTG9nTGV2ZWwiwwEKBlN0YXR1cxIOCgZtZW1vcnkYASABKAQSEgoKZ29yb3V0aW5lcxgCIAEoBRIVCg1jb25uZWN0aW9uc0luGAMgASgFEhYKDmNvbm5lY3Rpb25zT3V0GAQgASgFEhgKEHRyYWZmaWNBdmFpbGFibGUYBSABKAgSDgoGdXBsaW5rGAYgASgDEhAKCGRvd25saW5rGAcgASgDEhMKC3VwbGlua1RvdGFsGAggASgDEhUKDWRvd25saW5rVG90YWwYCSABKAMiJgoGR3JvdXBzEhwKBWdyb3VwGAEgAygLMg0uZGFlbW9uLkdyb3VwInwKBUdyb3VwEgsKA3RhZxgBIAEoCRIMCgR0eXBlGAIgASgJEhIKCnNlbGVjdGFibGUYAyABKAgSEAoIc2VsZWN0ZWQYBCABKAkSEAoIaXNFeHBhbmQYBSABKAgSIAoFaXRlbXMYBiADKAsyES5kYWVtb24uR3JvdXBJdGVtIlEKCUdyb3VwSXRlbRILCgN0YWcYASABKAkSDAoEdHlwZRgCIAEoCRITCgt1cmxUZXN0VGltZRgDIAEoAxIUCgx1cmxUZXN0RGVsYXkYBCABKAUiJQoOVVJMVGVzdFJlcXVlc3QSEwoLb3V0Ym91bmRUYWcYASABKAkiPgoVU2VsZWN0T3V0Ym91bmRSZXF1ZXN0EhAKCGdyb3VwVGFnGAEgASgJEhMKC291dGJvdW5kVGFnGAIgASgJIjsKFVNldEdyb3VwRXhwYW5kUmVxdWVzdBIQCghncm91cFRhZxgBIAEoCRIQCghpc0V4cGFuZBgCIAEoCCIZCglDbGFzaE1vZGUSDAoEbW9kZRgDIAEoCSI4Cg9DbGFzaE1vZGVTdGF0dXMSEAoIbW9kZUxpc3QYASADKAkSEwoLY3VycmVudE1vZGUYAiABKAkiLwobU3Vic2NyaWJlQ29ubmVjdGlvbnNSZXF1ZXN0EhAKCGludGVydmFsGAEgASgDIq4BCg9Db25uZWN0aW9uRXZlbnQSKQoEdHlwZRgBIAEoDjIbLmRhZW1vbi5Db25uZWN0aW9uRXZlbnRUeXBlEgoKAmlkGAIgASgJEiYKCmNvbm5lY3Rpb24YAyABKAsyEi5kYWVtb24uQ29ubmVjdGlvbhITCgt1cGxpbmtEZWx0YRgEIAEoAxIVCg1kb3dubGlua0RlbHRhGAUgASgDEhAKCGNsb3NlZEF0GAYgASgDIkoKEENvbm5lY3Rpb25FdmVudHMSJwoGZXZlbnRzGAEgAygLMhcuZGFlbW9uLkNvbm5lY3Rpb25FdmVudBINCgVyZXNldBgCIAEoCCKzAwoKQ29ubmVjdGlvbhIKCgJpZBgBIAEoCRIPCgdpbmJvdW5kGAIgASgJEhMKC2luYm91bmRUeXBlGAMgASgJEhEKCWlwVmVyc2lvbhgEIAEoBRIPCgduZXR3b3JrGAUgASgJEg4KBnNvdXJjZRgGIAEoCRITCgtkZXN0aW5hdGlvbhgHIAEoCRIOCgZkb21haW4YCCABKAkSEAoIcHJvdG9jb2wYCSABKAkSDAoEdXNlchgKIAEoCRIUCgxmcm9tT3V0Ym91bmQYCyABKAkSEQoJY3JlYXRlZEF0GAwgASgDEhAKCGNsb3NlZEF0GA0gASgDEg4KBnVwbGluaxgOIAEoAxIQCghkb3dubGluaxgPIAEoAxITCgt1cGxpbmtUb3RhbBgQIAEoAxIVCg1kb3dubGlua1RvdGFsGBEgASgDEgwKBHJ1bGUYEiABKAkSEAoIb3V0Ym91bmQYEyABKAkSFAoMb3V0Ym91bmRUeXBlGBQgASgJEhEKCWNoYWluTGlzdBgVIAMoCRIoCgtwcm9jZXNzSW5mbxgWIAEoCzITLmRhZW1vbi5Qcm9jZXNzSW5mbyJtCgtQcm9jZXNzSW5mbxIRCglwcm9jZXNzSWQYASABKA0SDgoGdXNlcklkGAIgASgFEhAKCHVzZXJOYW1lGAMgASgJEhMKC3Byb2Nlc3NQYXRoGAQgASgJEhQKDHBhY2thZ2VOYW1lcxgFIAMoCSIkChZDbG9zZUNvbm5lY3Rpb25SZXF1ZXN0EgoKAmlkGAEgASgJIkEKEkRlcHJlY2F0ZWRXYXJuaW5ncxIrCgh3YXJuaW5ncxgBIAMoCzIZLmRhZW1vbi5EZXByZWNhdGVkV2FybmluZyKYAQoRRGVwcmVjYXRlZFdhcm5pbmcSDwoHbWVzc2FnZRgBIAEoCRIRCglpbXBlbmRpbmcYAiABKAgSFQoNbWlncmF0aW9uTGluaxgDIAEoCRITCgtkZXNjcmlwdGlvbhgEIAEoCRIZChFkZXByZWNhdGVkVmVyc2lvbhgFIAEoCRIYChBzY2hlZHVsZWRWZXJzaW9uGAYgASgJIh4KCVN0YXJ0ZWRBdBIRCglzdGFydGVkQXQYASABKAMiNAoMT3V0Ym91bmRMaXN0EiQKCW91dGJvdW5kcxgBIAMoCzIRLmRhZW1vbi5Hcm91cEl0ZW0ifQoZTmV0d29ya1F1YWxpdHlUZXN0UmVxdWVzdBIRCgljb25maWdVUkwYASABKAkSEwoLb3V0Ym91bmRUYWcYAiABKAkSDgoGc2VyaWFsGAMgASgIEhkKEW1heFJ1bnRpbWVTZWNvbmRzGAQgASgFEg0KBWh0dHAzGAUgASgIIskCChpOZXR3b3JrUXVhbGl0eVRlc3RQcm9ncmVzcxINCgVwaGFzZRgBIAEoBRIYChBkb3dubG9hZENhcGFjaXR5GAIgASgDEhYKDnVwbG9hZENhcGFjaXR5GAMgASgDEhMKC2Rvd25sb2FkUlBNGAQgASgFEhEKCXVwbG9hZFJQTRgFIAEoBRIVCg1pZGxlTGF0ZW5jeU1zGAYgASgFEhEKCWVsYXBzZWRNcxgHIAEoAxIPCgdpc0ZpbmFsGAggASgIEg0KBWVycm9yGAkgASgJEiAKGGRvd25sb2FkQ2FwYWNpdHlBY2N1cmFjeRgKIAEoBRIeChZ1cGxvYWRDYXBhY2l0eUFjY3VyYWN5GAsgASgFEhsKE2Rvd25sb2FkUlBNQWNjdXJhY3kYDCABKAUSGQoRdXBsb2FkUlBNQWNjdXJhY3kYDSABKAUiNgoPU1RVTlRlc3RSZXF1ZXN0Eg4KBnNlcnZlchgBIAEoCRITCgtvdXRib3VuZFRhZxgCIAEoCSKuAQoQU1RVTlRlc3RQcm9ncmVzcxINCgVwaGFzZRgBIAEoBRIUCgxleHRlcm5hbEFkZHIYAiABKAkSEQoJbGF0ZW5jeU1zGAMgASgFEhIKCm5hdE1hcHBpbmcYBCABKAUSFAoMbmF0RmlsdGVyaW5nGAUgASgFEg8KB2lzRmluYWwYBiABKAgSDQoFZXJyb3IYByABKAkSGAoQbmF0VHlwZVN1cHBvcnRlZBgIIAEoCCJLChVUYWlsc2NhbGVTdGF0dXNVcGRhdGUSMgoJZW5kcG9pbnRzGAEgAygLMh8uZGFlbW9uLlRhaWxzY2FsZUVuZHBvaW50U3RhdHVzIpECChdUYWlsc2NhbGVFbmRwb2ludFN0YXR1cxITCgtlbmRwb2ludFRhZxgBIAEoCRIUCgxiYWNrZW5kU3RhdGUYAiABKAkSDwoHYXV0aFVSTBgDIAEoCRITCgtuZXR3b3JrTmFtZRgEIAEoCRIWCg5tYWdpY0ROU1N1ZmZpeBgFIAEoCRIjCgRzZWxmGAYgASgLMhUuZGFlbW9uLlRhaWxzY2FsZVBlZXISLgoKdXNlckdyb3VwcxgHIAMoCzIaLmRhZW1vbi5UYWlsc2NhbGVVc2VyR3JvdXASJwoIZXhpdE5vZGUYCCABKAsyFS5kYWVtb24uVGFpbHNjYWxlUGVlchIPCgdrZXlBdXRoGAkgASgIIokBChJUYWlsc2NhbGVVc2VyR3JvdXASDgoGdXNlcklEGAEgASgDEhEKCWxvZ2luTmFtZRgCIAEoCRITCgtkaXNwbGF5TmFtZRgDIAEoCRIVCg1wcm9maWxlUGljVVJMGAQgASgJEiQKBXBlZXJzGAUgAygLMhUuZGFlbW9uLlRhaWxzY2FsZVBlZXIisQIKDVRhaWxzY2FsZVBlZXISEAoIaG9zdE5hbWUYASABKAkSDwoHZG5zTmFtZRgCIAEoCRIKCgJvcxgDIAEoCRIUCgx0YWlsc2NhbGVJUHMYBCADKAkSDgoGb25saW5lGAUgASgIEhAKCGV4aXROb2RlGAYgASgIEhYKDmV4aXROb2RlT3B0aW9uGAcgASgIEg4KBmFjdGl2ZRgIIAEoCBIPCgdyeEJ5dGVzGAkgASgDEg8KB3R4Qnl0ZXMYCiABKAMSEQoJa2V5RXhwaXJ5GAsgASgDEhAKCHN0YWJsZUlEGAwgASgJEg8KB2V4cGlyZWQYDSABKAgSEwoLc3NoSG9zdEtleXMYDiADKAkSEgoKc2hhcmVlTm9kZRgPIAEoCBIQCghsYXN0U2VlbhgQIAEoAyI7ChRUYWlsc2NhbGVQaW5nUmVxdWVzdBITCgtlbmRwb2ludFRhZxgBIAEoCRIOCgZwZWVySVAYAiABKAkiiwEKFVRhaWxzY2FsZVBpbmdSZXNwb25zZRIRCglsYXRlbmN5TXMYASABKAESEAoIaXNEaXJlY3QYAiABKAgSEAoIZW5kcG9pbnQYAyABKAkSFAoMZGVycFJlZ2lvbklEGAQgASgFEhYKDmRlcnBSZWdpb25Db2RlGAUgASgJEg0KBWVycm9yGAYgASgJIkQKG1NldFRhaWxzY2FsZUV4aXROb2RlUmVxdWVzdBITCgtlbmRwb2ludFRhZxgBIAEoCRIQCghzdGFibGVJRBgCIAEoCSItChZUYWlsc2NhbGVMb2dvdXRSZXF1ZXN0EhMKC2VuZHBvaW50VGFnGAEgASgJIqwBChlUYWlsc2NhbGVTU0hDbGllbnRNZXNzYWdlEioKBXN0YXJ0GAEgASgLMhkuZGFlbW9uLlRhaWxzY2FsZVNTSFN0YXJ0SAASKgoFaW5wdXQYAiABKAsyGS5kYWVtb24uVGFpbHNjYWxlU1NISW5wdXRIABIsCgZyZXNpemUYAyABKAsyGi5kYWVtb24uVGFpbHNjYWxlU1NIUmVzaXplSABCCQoHbWVzc2FnZSLYAQoRVGFpbHNjYWxlU1NIU3RhcnQSEwoLZW5kcG9pbnRUYWcYASABKAkSEwoLcGVlckFkZHJlc3MYAiABKAkSEAoIdXNlcm5hbWUYAyABKAkSFAoMdGVybWluYWxUeXBlGAQgASgJEg8KB2NvbHVtbnMYBSABKAUSDAoEcm93cxgGIAEoBRITCgt3aWR0aFBpeGVscxgHIAEoBRIUCgxoZWlnaHRQaXhlbHMYCCABKAUSEAoIaG9zdEtleXMYCSADKAkSFQoNZm9yd2FyZF9hZ2VudBgKIAEoCCIhChFUYWlsc2NhbGVTU0hJbnB1dBIMCgRkYXRhGAEgASgMIl4KElRhaWxzY2FsZVNTSFJlc2l6ZRIPCgdjb2x1bW5zGAEgASgFEgwKBHJvd3MYAiABKAUSEwoLd2lkdGhQaXhlbHMYAyABKAUSFAoMaGVpZ2h0UGl4ZWxzGAQgASgFIowCChlUYWlsc2NhbGVTU0hTZXJ2ZXJNZXNzYWdlEjQKCmF1dGhCYW5uZXIYASABKAsyHi5kYWVtb24uVGFpbHNjYWxlU1NIQXV0aEJhbm5lckgAEioKBXJlYWR5GAIgASgLMhkuZGFlbW9uLlRhaWxzY2FsZVNTSFJlYWR5SAASLAoGb3V0cHV0GAMgASgLMhouZGFlbW9uLlRhaWxzY2FsZVNTSE91dHB1dEgAEigKBGV4aXQYBCABKAsyGC5kYWVtb24uVGFpbHNjYWxlU1NIRXhpdEgAEioKBWVycm9yGAUgASgLMhkuZGFlbW9uLlRhaWxzY2FsZVNTSEVycm9ySABCCQoHbWVzc2FnZSIpChZUYWlsc2NhbGVTU0hBdXRoQmFubmVyEg8KB21lc3NhZ2UYASABKAkiEwoRVGFpbHNjYWxlU1NIUmVhZHkiIgoSVGFpbHNjYWxlU1NIT3V0cHV0EgwKBGRhdGEYASABKAwiSgoQVGFpbHNjYWxlU1NIRXhpdBIQCghleGl0Q29kZRgBIAEoBRIOCgZzaWduYWwYAiABKAkSFAoMZXJyb3JNZXNzYWdlGAMgASgJIiQKEVRhaWxzY2FsZVNTSEVycm9yEg8KB21lc3NhZ2UYASABKAkipAEKElVTQlByb3ZpZGVyTWVzc2FnZRIpCgZhdHRhY2gYASABKAsyFy5kYWVtb24uVVNCRGV2aWNlQXR0YWNoSAASKQoGZGV0YWNoGAIgASgLMhcuZGFlbW9uLlVTQkRldmljZURldGFjaEgAEi0KC3VyYlJlc3BvbnNlGAMgASgLMhYuZGFlbW9uLlVTQlVSQlJlc3BvbnNlSABCCQoHbWVzc2FnZSLBAQoQVVNCU2VydmVyTWVzc2FnZRInCgVyZWFkeRgBIAEoCzIWLmRhZW1vbi5VU0JEZXZpY2VSZWFkeUgAEisKCnVyYlJlcXVlc3QYAiABKAsyFS5kYWVtb24uVVNCVVJCUmVxdWVzdEgAEikKBWFib3J0GAMgASgLMhguZGFlbW9uLlVTQkVuZHBvaW50QWJvcnRIABIhCgVlcnJvchgEIAEoCzIQLmRhZW1vbi5VU0JFcnJvckgAQgkKB21lc3NhZ2Ui1QIKE1VTQkRldmljZURlc2NyaXB0b3ISEAoIZGV2aWNlSWQYASABKAkSDgoGYnVzTnVtGAIgASgNEg4KBmRldk51bRgDIAEoDRINCgVzcGVlZBgEIAEoDRIQCgh2ZW5kb3JJZBgFIAEoDRIRCglwcm9kdWN0SWQYBiABKA0SEQoJYmNkRGV2aWNlGAcgASgNEhMKC2RldmljZUNsYXNzGAggASgNEhYKDmRldmljZVN1YkNsYXNzGAkgASgNEhYKDmRldmljZVByb3RvY29sGAogASgNEhoKEmNvbmZpZ3VyYXRpb25WYWx1ZRgLIAEoDRIZChFudW1Db25maWd1cmF0aW9ucxgMIAEoDRIoCgppbnRlcmZhY2VzGA0gAygLMhQuZGFlbW9uLlVTQkludGVyZmFjZRIOCgZzZXJpYWwYDiABKAkSDwoHcHJvZHVjdBgPIAEoCSJVCg9VU0JEZXZpY2VBdHRhY2gSEQoJc2VydmVyVGFnGAEgASgJEi8KCmRlc2NyaXB0b3IYAiABKAsyGy5kYWVtb24uVVNCRGV2aWNlRGVzY3JpcHRvciJcCgxVU0JJbnRlcmZhY2USFgoOaW50ZXJmYWNlQ2xhc3MYASABKA0SGQoRaW50ZXJmYWNlU3ViQ2xhc3MYAiABKA0SGQoRaW50ZXJmYWNlUHJvdG9jb2wYAyABKA0iIwoPVVNCRGV2aWNlRGV0YWNoEhAKCGRldmljZUlkGAEgASgJIjEKDlVTQkRldmljZVJlYWR5EhAKCGRldmljZUlkGAEgASgJEg0KBWJ1c0lkGAIgASgJIpMCCg1VU0JVUkJSZXF1ZXN0EhAKCGRldmljZUlkGAEgASgJEgsKA3NlcRgCIAEoBBIQCghlbmRwb2ludBgDIAEoDRITCgtkaXJlY3Rpb25JbhgEIAEoCBIVCg10cmFuc2ZlckZsYWdzGAUgASgNEg0KBXNldHVwGAYgASgMEhwKFHRyYW5zZmVyQnVmZmVyTGVuZ3RoGAcgASgNEg8KB291dERhdGEYCCABKAwSFwoPbnVtYmVyT2ZQYWNrZXRzGAkgASgFEhIKCnN0YXJ0RnJhbWUYCiABKAUSEAoIaW50ZXJ2YWwYCyABKAUSKAoKaXNvUGFja2V0cxgMIAMoCzIULmRhZW1vbi5VU0JJc29QYWNrZXQijwEKDlVTQlVSQlJlc3BvbnNlEhAKCGRldmljZUlkGAEgASgJEgsKA3NlcRgCIAEoBBIOCgZzdGF0dXMYAyABKAUSFAoMYWN0dWFsTGVuZ3RoGAQgASgFEg4KBmluRGF0YRgFIAEoDBIoCgppc29QYWNrZXRzGAYgAygLMhQuZGFlbW9uLlVTQklzb1BhY2tldCJUCgxVU0JJc29QYWNrZXQSDgoGb2Zmc2V0GAEgASgFEg4KBmxlbmd0aBgCIAEoBRIUCgxhY3R1YWxMZW5ndGgYAyABKAUSDgoGc3RhdHVzGAQgASgFIjYKEFVTQkVuZHBvaW50QWJvcnQSEAoIZGV2aWNlSWQYASABKAkSEAoIZW5kcG9pbnQYAiABKA0iLQoIVVNCRXJyb3ISEAoIZGV2aWNlSWQYASABKAkSDwoHbWVzc2FnZRgCIAEoCSJFChdVU0JJUFNlcnZlclN0YXR1c1VwZGF0ZRIqCgdzZXJ2ZXJzGAEgAygLMhkuZGFlbW9uLlVTQklQU2VydmVyU3RhdHVzIlAKEVVTQklQU2VydmVyU3RhdHVzEhEKCXNlcnZlclRhZxgBIAEoCRIoCgdkZXZpY2VzGAIgAygLMhcuZGFlbW9uLlVTQlNoYXJlZERldmljZSKvAQoPVVNCU2hhcmVkRGV2aWNlEi8KCmRlc2NyaXB0b3IYASABKAsyGy5kYWVtb24uVVNCRGV2aWNlRGVzY3JpcHRvchINCgVidXNJZBgCIAEoCRIQCghzdGFibGVJZBgDIAEoCRIjCgdiYWNrZW5kGAQgASgOMhIuZGFlbW9uLlVTQkJhY2tlbmQSJQoFc3RhdGUYBSABKA4yFi5kYWVtb24uVVNCRGV2aWNlU3RhdGUqVQoITG9nTGV2ZWwSCQoFUEFOSUMQABIJCgVGQVRBTBABEgkKBUVSUk9SEAISCAoEV0FSThADEggKBElORk8QBBIJCgVERUJVRxAFEgkKBVRSQUNFEAYqaQoTQ29ubmVjdGlvbkV2ZW50VHlwZRIYChRDT05ORUNUSU9OX0VWRU5UX05FVxAAEhsKF0NPTk5FQ1RJT05fRVZFTlRfVVBEQVRFEAESGwoXQ09OTkVDVElPTl9FVkVOVF9DTE9TRUQQAipsCg5VU0JEZXZpY2VTdGF0ZRIZChVVU0JfREVWSUNFX1NUQVRFX0lETEUQABIdChlVU0JfREVWSUNFX1NUQVRFX0FUVEFDSEVEEAESIAocVVNCX0RFVklDRV9TVEFURV9VTkFWQUlMQUJMRRACKp4BCgpVU0JCYWNrZW5kEhsKF1VTQl9CQUNLRU5EX1VOU1BFQ0lGSUVEEAASGwoXVVNCX0JBQ0tFTkRfTElOVVhfU1lTRlMQARIXChNVU0JfQkFDS0VORF9EWU5BTUlDEAISHAoYVVNCX0JBQ0tFTkRfREFSV0lOX0lPS0lUEAMSHwobVVNCX0JBQ0tFTkRfV0lORE9XU19WQk9YVVNCEAQymhEKDlN0YXJ0ZWRTZXJ2aWNlEjcKCkdldFZlcnNpb24SFi5nb29nbGUucHJvdG9idWYuRW1wdHkaDy5kYWVtb24uVmVyc2lvbiIAEksKFlN1YnNjcmliZVNlcnZpY2VTdGF0dXMSFi5nb29nbGUucHJvdG9idWYuRW1wdHkaFS5kYWVtb24uU2VydmljZVN0YXR1cyIAMAESNwoMU3Vic2NyaWJlTG9nEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GgsuZGFlbW9uLkxvZyIAMAESRwoSR2V0RGVmYXVsdExvZ0xldmVsEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhcuZGFlbW9uLkRlZmF1bHRMb2dMZXZlbCIAEj0KCUNsZWFyTG9ncxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEkUKD1N1YnNjcmliZVN0YXR1cxIeLmRhZW1vbi5TdWJzY3JpYmVTdGF0dXNSZXF1ZXN0Gg4uZGFlbW9uLlN0YXR1cyIAMAESPQoPU3Vic2NyaWJlR3JvdXBzEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5Gg4uZGFlbW9uLkdyb3VwcyIAMAESRwoSR2V0Q2xhc2hNb2RlU3RhdHVzEhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhcuZGFlbW9uLkNsYXNoTW9kZVN0YXR1cyIAEkMKElN1YnNjcmliZUNsYXNoTW9kZRIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoRLmRhZW1vbi5DbGFzaE1vZGUiADABEjsKDFNldENsYXNoTW9kZRIRLmRhZW1vbi5DbGFzaE1vZGUaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABI7CgdVUkxUZXN0EhYuZGFlbW9uLlVSTFRlc3RSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASSQoOU2VsZWN0T3V0Ym91bmQSHS5kYWVtb24uU2VsZWN0T3V0Ym91bmRSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASSQoOU2V0R3JvdXBFeHBhbmQSHS5kYWVtb24uU2V0R3JvdXBFeHBhbmRSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASRAoQVHJpZ2dlck9PTVJlcG9ydBIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAElkKFFN1YnNjcmliZUNvbm5lY3Rpb25zEiMuZGFlbW9uLlN1YnNjcmliZUNvbm5lY3Rpb25zUmVxdWVzdBoYLmRhZW1vbi5Db25uZWN0aW9uRXZlbnRzIgAwARJLCg9DbG9zZUNvbm5lY3Rpb24SHi5kYWVtb24uQ2xvc2VDb25uZWN0aW9uUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEkcKE0Nsb3NlQWxsQ29ubmVjdGlvbnMSFi5nb29nbGUucHJvdG9idWYuRW1wdHkaFi5nb29nbGUucHJvdG9idWYuRW1wdHkiABJNChVHZXREZXByZWNhdGVkV2FybmluZ3MSFi5nb29nbGUucHJvdG9idWYuRW1wdHkaGi5kYWVtb24uRGVwcmVjYXRlZFdhcm5pbmdzIgASOwoMR2V0U3RhcnRlZEF0EhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5GhEuZGFlbW9uLlN0YXJ0ZWRBdCIAEkYKElN1YnNjcmliZU91dGJvdW5kcxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRoULmRhZW1vbi5PdXRib3VuZExpc3QiADABEmQKF1N0YXJ0TmV0d29ya1F1YWxpdHlUZXN0EiEuZGFlbW9uLk5ldHdvcmtRdWFsaXR5VGVzdFJlcXVlc3QaIi5kYWVtb24uTmV0d29ya1F1YWxpdHlUZXN0UHJvZ3Jlc3MiADABEkYKDVN0YXJ0U1RVTlRlc3QSFy5kYWVtb24uU1RVTlRlc3RSZXF1ZXN0GhguZGFlbW9uLlNUVU5UZXN0UHJvZ3Jlc3MiADABElUKGFN1YnNjcmliZVRhaWxzY2FsZVN0YXR1cxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRodLmRhZW1vbi5UYWlsc2NhbGVTdGF0dXNVcGRhdGUiADABElUKElN0YXJ0VGFpbHNjYWxlUGluZxIcLmRhZW1vbi5UYWlsc2NhbGVQaW5nUmVxdWVzdBodLmRhZW1vbi5UYWlsc2NhbGVQaW5nUmVzcG9uc2UiADABElUKFFNldFRhaWxzY2FsZUV4aXROb2RlEiMuZGFlbW9uLlNldFRhaWxzY2FsZUV4aXROb2RlUmVxdWVzdBoWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eSIAEksKD1RhaWxzY2FsZUxvZ291dBIeLmRhZW1vbi5UYWlsc2NhbGVMb2dvdXRSZXF1ZXN0GhYuZ29vZ2xlLnByb3RvYnVmLkVtcHR5IgASZgoYU3RhcnRUYWlsc2NhbGVTU0hTZXNzaW9uEiEuZGFlbW9uLlRhaWxzY2FsZVNTSENsaWVudE1lc3NhZ2UaIS5kYWVtb24uVGFpbHNjYWxlU1NIU2VydmVyTWVzc2FnZSIAKAEwARJPChFQcm92aWRlVVNCRGV2aWNlcxIaLmRhZW1vbi5VU0JQcm92aWRlck1lc3NhZ2UaGC5kYWVtb24uVVNCU2VydmVyTWVzc2FnZSIAKAEwARJZChpTdWJzY3JpYmVVU0JJUFNlcnZlclN0YXR1cxIWLmdvb2dsZS5wcm90b2J1Zi5FbXB0eRofLmRhZW1vbi5VU0JJUFNlcnZlclN0YXR1c1VwZGF0ZSIAMAFCJVojZ2l0aHViLmNvbS9zYWdlcm5ldC9zaW5nLWJveC9kYWVtb25iBnByb3RvMw",[Qxe]),ket=Pu(eS,36),Pet=Pu(eS,40),Det=Pu(eS,46),Oet=Pu(eS,47);var va=(e=>(e[e.PANIC=0]="PANIC",e[e.FATAL=1]="FATAL",e[e.ERROR=2]="ERROR",e[e.WARN=3]="WARN",e[e.INFO=4]="INFO",e[e.DEBUG=5]="DEBUG",e[e.TRACE=6]="TRACE",e))(va||{}),DT=(e=>(e[e.CONNECTION_EVENT_NEW=0]="CONNECTION_EVENT_NEW",e[e.CONNECTION_EVENT_UPDATE=1]="CONNECTION_EVENT_UPDATE",e[e.CONNECTION_EVENT_CLOSED=2]="CONNECTION_EVENT_CLOSED",e))(DT||{}),tTe=(e=>(e[e.USB_DEVICE_STATE_IDLE=0]="USB_DEVICE_STATE_IDLE",e[e.USB_DEVICE_STATE_ATTACHED=1]="USB_DEVICE_STATE_ATTACHED",e[e.USB_DEVICE_STATE_UNAVAILABLE=2]="USB_DEVICE_STATE_UNAVAILABLE",e))(tTe||{}),nTe=(e=>(e[e.USB_BACKEND_UNSPECIFIED=0]="USB_BACKEND_UNSPECIFIED",e[e.USB_BACKEND_LINUX_SYSFS=1]="USB_BACKEND_LINUX_SYSFS",e[e.USB_BACKEND_DYNAMIC=2]="USB_BACKEND_DYNAMIC",e[e.USB_BACKEND_DARWIN_IOKIT=3]="USB_BACKEND_DARWIN_IOKIT",e[e.USB_BACKEND_WINDOWS_VBOXUSB=4]="USB_BACKEND_WINDOWS_VBOXUSB",e))(nTe||{});const y5=Yxe(eS,0);var An;(function(e){e[e.Canceled=1]="Canceled",e[e.Unknown=2]="Unknown",e[e.InvalidArgument=3]="InvalidArgument",e[e.DeadlineExceeded=4]="DeadlineExceeded",e[e.NotFound=5]="NotFound",e[e.AlreadyExists=6]="AlreadyExists",e[e.PermissionDenied=7]="PermissionDenied",e[e.ResourceExhausted=8]="ResourceExhausted",e[e.FailedPrecondition=9]="FailedPrecondition",e[e.Aborted=10]="Aborted",e[e.OutOfRange=11]="OutOfRange",e[e.Unimplemented=12]="Unimplemented",e[e.Internal=13]="Internal",e[e.Unavailable=14]="Unavailable",e[e.DataLoss=15]="DataLoss",e[e.Unauthenticated=16]="Unauthenticated"})(An||(An={}));function rTe(e,t){$Z(t,e);const n=oTe(e.$unknown,t),[r,i,o]=BI(t);for(const a of n)LZ(r,new s5(a.data),i,a.wireType,{readUnknownFields:!0});return o()}function iTe(e,t,n){var r;$Z(t,e);const i=((r=e.$unknown)!==null&&r!==void 0?r:[]).filter(u=>u.no!==t.number),[o,a]=BI(t,n),s=new mZ;kZ(s,{writeUnknownFields:!0},o,a);const l=new s5(s.finish());for(;l.pos=0;--n)if(e[n].no==t.number)return[e[n]];return[]}return e.filter(n=>n.no===t.number)}function BI(e,t){const n=e.typeName,r=Object.assign(Object.assign({},e),{kind:"field",parent:e.extendee,localName:n}),i=Object.assign(Object.assign({},e.extendee),{fields:[r],members:[r],oneofs:[]}),o=Vs(i,t!==void 0?{[n]:t}:void 0);return[xl(i,o),r,()=>{const a=o[n];if(a===void 0){const s=e.message;return dy(s)?ym(s.fields[0].scalar,s.fields[0].longAsString):Vs(s)}return a}]}function $Z(e,t){if(e.extendee.typeName!=t.$typeName)throw new Error(`extension ${e.typeName} can only be applied to message ${e.extendee.typeName}`)}const aTe=3,sTe=2,Z8={alwaysEmitImplicit:!1,enumAsInteger:!1,useProtoFieldName:!1};function lTe(e){return e?Object.assign(Object.assign({},Z8),e):Z8}function uTe(e,t,n){return tS(xl(e,t),lTe(n))}function cTe(e,t,n){var r;const i=uTe(e,t,n);return JSON.stringify(i,null,(r=n?.prettySpaces)!==null&&r!==void 0?r:0)}function tS(e,t){var n;const r=BZ(e,t);if(r!==void 0)return r;const i={};for(const o of e.sortedFields){if(!e.isSet(o)){if(o.presence==aTe)throw new Error(`cannot encode ${o} to JSON: required field not set`);if(!t.alwaysEmitImplicit||o.presence!==sTe)continue}const a=J8(o,e.get(o),t);a!==void 0&&(i[hTe(o,t)]=a)}if(t.registry){const o=new Set;for(const{no:a}of(n=e.getUnknown())!==null&&n!==void 0?n:[])if(!o.has(a)){o.add(a);const s=t.registry.getExtensionFor(e.desc,a);if(!s)continue;const l=rTe(e.message,s),[u,c]=BI(s,l),f=J8(c,u.get(c),t);f!==void 0&&(i[s.jsonName]=f)}}return i}function J8(e,t,n){switch(e.fieldKind){case"scalar":return VI(e,t);case"message":return tS(t,n);case"enum":return b5(e.enum,t,n.enumAsInteger);case"list":return dTe(t,n);case"map":return fTe(t,n)}}function fTe(e,t){const n=e.field(),r={};switch(n.mapKind){case"scalar":for(const[i,o]of e)r[i]=VI(n,o);break;case"message":for(const[i,o]of e)r[i]=tS(o,t);break;case"enum":for(const[i,o]of e)r[i]=b5(n.enum,o,t.enumAsInteger);break}return t.alwaysEmitImplicit||e.size>0?r:void 0}function dTe(e,t){const n=e.field(),r=[];switch(n.listKind){case"scalar":for(const i of e)r.push(VI(n,i));break;case"enum":for(const i of e)r.push(b5(n.enum,i,t.enumAsInteger));break;case"message":for(const i of e)r.push(tS(i,t));break}return t.alwaysEmitImplicit||r.length>0?r:void 0}function b5(e,t,n){var r;if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: expected number, got ${$i(t)}`);if(e.typeName=="google.protobuf.NullValue")return null;if(n)return t;const i=e.value[t];return(r=i?.name)!==null&&r!==void 0?r:t}function VI(e,t){var n,r,i,o,a,s;switch(e.scalar){case De.INT32:case De.SFIXED32:case De.SINT32:case De.FIXED32:case De.UINT32:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(n=Ih(e,t))===null||n===void 0?void 0:n.message}`);return t;case De.FLOAT:case De.DOUBLE:if(typeof t!="number")throw new Error(`cannot encode ${e} to JSON: ${(r=Ih(e,t))===null||r===void 0?void 0:r.message}`);return Number.isNaN(t)?"NaN":t===Number.POSITIVE_INFINITY?"Infinity":t===Number.NEGATIVE_INFINITY?"-Infinity":t;case De.STRING:if(typeof t!="string")throw new Error(`cannot encode ${e} to JSON: ${(i=Ih(e,t))===null||i===void 0?void 0:i.message}`);return t;case De.BOOL:if(typeof t!="boolean")throw new Error(`cannot encode ${e} to JSON: ${(o=Ih(e,t))===null||o===void 0?void 0:o.message}`);return t;case De.UINT64:case De.FIXED64:case De.INT64:case De.SFIXED64:case De.SINT64:if(typeof t=="bigint"||typeof t=="string"||typeof t=="number"&&Number.isInteger(t))return t.toString();throw new Error(`cannot encode ${e} to JSON: ${(a=Ih(e,t))===null||a===void 0?void 0:a.message}`);case De.BYTES:if(t instanceof Uint8Array)return mxe(t);throw new Error(`cannot encode ${e} to JSON: ${(s=Ih(e,t))===null||s===void 0?void 0:s.message}`)}}function hTe(e,t){return t.useProtoFieldName?e.name:e.jsonName}function BZ(e,t){if(e.desc.typeName.startsWith("google.protobuf."))switch(e.desc.typeName){case"google.protobuf.Any":return pTe(e.message,t);case"google.protobuf.Timestamp":return mTe(e.message);case"google.protobuf.Duration":return vTe(e.message);case"google.protobuf.FieldMask":return gTe(e.message);case"google.protobuf.Struct":return VZ(e.message);case"google.protobuf.Value":return _5(e.message);case"google.protobuf.ListValue":return UZ(e.message);default:if(dy(e.desc)){const n=e.desc.fields[0];return VI(n,e.get(n))}return}}function pTe(e,t){if(e.typeUrl==="")return{};const{registry:n}=t;let r,i;if(n&&(r=Zxe(e,n),r&&(i=n.getMessage(r.$typeName))),!i||!r)throw new Error(`cannot encode message ${e.$typeName} to JSON: "${e.typeUrl}" is not in the type registry`);const o=xl(i,r),a=wZ(i)?{value:BZ(o,t)}:tS(o,t);return a["@type"]=e.typeUrl,a}function vTe(e){const t=Number(e.seconds),n=e.nanos;if(t>315576e6||t<-315576e6)throw new Error(`cannot encode message ${e.$typeName} to JSON: value out of range`);if(t>0&&n<0||t<0&&n>0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos sign must match seconds sign`);let r=e.seconds.toString();if(n!==0){let i=Math.abs(n).toString();i="0".repeat(9-i.length)+i,i.substring(3)==="000000"?i=i.substring(0,3):i.substring(6)==="000"&&(i=i.substring(0,6)),r+="."+i,n<0&&t==0&&(r="-"+r)}return r+"s"}function gTe(e){return e.paths.map(t=>{if(QK(mm(t))!==t)throw new Error(`cannot encode message ${e.$typeName} to JSON: lowerCamelCase of path name "${t}" is irreversible`);return mm(t)}).join(",")}function VZ(e){const t={};for(const[n,r]of Object.entries(e.fields))t[n]=_5(r);return t}function _5(e){switch(e.kind.case){case"nullValue":return null;case"numberValue":if(!Number.isFinite(e.kind.value))throw new Error(`${e.$typeName} cannot be NaN or Infinity`);return e.kind.value;case"boolValue":return e.kind.value;case"stringValue":return e.kind.value;case"structValue":return VZ(e.kind.value);case"listValue":return UZ(e.kind.value);default:throw new Error(`${e.$typeName} must have a value`)}}function UZ(e){return e.values.map(_5)}function mTe(e){const t=Number(e.seconds)*1e3;if(tDate.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot encode message ${e.$typeName} to JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);if(e.nanos<0)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be negative`);if(e.nanos>999999999)throw new Error(`cannot encode message ${e.$typeName} to JSON: nanos must not be greater than 99999999`);let n="Z";if(e.nanos>0){const r=(e.nanos+1e9).toString().substring(1);r.substring(3)==="000000"?n="."+r.substring(0,3)+"Z":r.substring(6)==="000"?n="."+r.substring(0,6)+"Z":n="."+r+"Z"}return new Date(t).toISOString().replace(".000Z",n)}const Q8={ignoreUnknownFields:!1};function yTe(e){return e?Object.assign(Object.assign({},Q8),e):Q8}function bTe(e,t,n){return _Te(e,ATe(t,e.typeName),n)}function _Te(e,t,n){const r=xl(e);try{M1(r,t,yTe(n))}catch(i){throw _xe(i)?new Error(`cannot decode ${i.field()} from JSON: ${i.message}`,{cause:i}):i}return r.message}const QR=new WeakMap;function STe(e,t){var n;if(!QR.has(e)){const r=new Map;for(const i of e.fields)r.set(i.name,i).set(i.jsonName,i);QR.set(e,r)}return(n=QR.get(e))===null||n===void 0?void 0:n.get(t)}function M1(e,t,n){var r;if(RTe(e,t,n))return;if(t==null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode ${e.desc} from JSON: ${$i(t)}`);const i=new Map;for(const[o,a]of Object.entries(t)){const s=STe(e.desc,o);if(s){if(s.oneof){if(a===null&&s.fieldKind=="scalar")continue;const l=i.get(s.oneof);if(l!==void 0)throw new Qa(s.oneof,`oneof set multiple times by ${l.name} and ${s.name}`);i.set(s.oneof,s)}q8(e,s,a,n)}else{let l;if(o.startsWith("[")&&o.endsWith("]")&&(l=(r=n.registry)===null||r===void 0?void 0:r.getExtension(o.substring(1,o.length-1)))&&l.extendee.typeName===e.desc.typeName){const[u,c,f]=BI(l);q8(u,c,a,n),iTe(e.message,l,f())}if(!l&&!n.ignoreUnknownFields)throw new Error(`cannot decode ${e.desc} from JSON: key "${o}" is unknown`)}}}function q8(e,t,n,r){switch(t.fieldKind){case"scalar":CTe(e,t,n);break;case"enum":ETe(e,t,n,r);break;case"message":TTe(e,t,n,r);break;case"list":xTe(e.get(t),n,r);break;case"map":wTe(e.get(t),n,r);break}}function GZ(e,t,n){if(e.scalar&&t!==null)return S5(e,t);if(e.message&&!JE(e,t)){const r=xl(e.message);return M1(r,t,n),r}if(e.enum&&!JE(e,t))return HZ(e.enum,t,n.ignoreUnknownFields);throw new Qa(e,`${e.fieldKind==="list"?"list item":"map value"} must not be null`)}function wTe(e,t,n){if(t===null)return;const r=e.field();if(typeof t!="object"||Array.isArray(t))throw new Qa(r,"expected object, got "+$i(t));for(const[i,o]of Object.entries(t)){const a=ITe(r.mapKey,i),s=GZ(r,o,n);s!==UI&&e.set(a,s)}}function xTe(e,t,n){if(t===null)return;const r=e.field();if(!Array.isArray(t))throw new Qa(r,"expected Array, got "+$i(t));for(const i of t){const o=GZ(r,i,n);o!==UI&&e.add(o)}}function TTe(e,t,n,r){if(JE(t,n)){e.clear(t);return}const i=e.isSet(t)?e.get(t):xl(t.message);M1(i,n,r),e.set(t,i)}function ETe(e,t,n,r){if(JE(t,n)){e.clear(t);return}const i=HZ(t.enum,n,r.ignoreUnknownFields);i!==UI&&e.set(t,i)}function CTe(e,t,n){n===null?e.clear(t):e.set(t,S5(t,n))}function JE(e,t){var n,r;return t===null&&((n=e.message)===null||n===void 0?void 0:n.typeName)!="google.protobuf.Value"&&((r=e.enum)===null||r===void 0?void 0:r.typeName)!="google.protobuf.NullValue"}const UI=Symbol();function HZ(e,t,n){if(t===null)return e.values[0].number;switch(typeof t){case"number":if(Number.isInteger(t))return t;break;case"string":const r=e.values.find(i=>i.name===t);if(r!==void 0)return r.number;if(n)return UI;break}throw new Error(`cannot decode ${e} from JSON: ${$i(t)}`)}function S5(e,t){switch(e.scalar){case De.DOUBLE:case De.FLOAT:if(t==="NaN")return NaN;if(t==="Infinity")return Number.POSITIVE_INFINITY;if(t==="-Infinity")return Number.NEGATIVE_INFINITY;if(typeof t=="number"){if(Number.isNaN(t))throw new Qa(e,"unexpected NaN number");if(!Number.isFinite(t))throw new Qa(e,"unexpected infinite number");break}if(typeof t=="string"){if(t===""||t.trim().length!==t.length)break;const n=Number(t);if(!Number.isFinite(n))break;return n}break;case De.INT32:case De.FIXED32:case De.SFIXED32:case De.SINT32:case De.UINT32:return WZ(t);case De.BYTES:if(typeof t=="string"){if(t==="")return new Uint8Array(0);try{return t5(t)}catch(n){const r=n instanceof Error?n.message:String(n);throw new Qa(e,r)}}break}return t}function ITe(e,t){switch(e){case De.BOOL:switch(t){case"true":return!0;case"false":return!1}return t;case De.INT32:case De.FIXED32:case De.UINT32:case De.SFIXED32:case De.SINT32:return WZ(t);default:return t}}function WZ(e){if(typeof e=="string"){if(e===""||e.trim().length!==e.length)return e;const t=Number(e);return Number.isNaN(t)?e:t}return e}function ATe(e,t){try{return JSON.parse(e)}catch(n){const r=n instanceof Error?n.message:String(n);throw new Error(`cannot decode message ${t} from JSON: ${r}`,{cause:n})}}function RTe(e,t,n){if(!e.desc.typeName.startsWith("google.protobuf."))return!1;switch(e.desc.typeName){case"google.protobuf.Any":return kTe(e.message,t,n),!0;case"google.protobuf.Timestamp":return PTe(e.message,t),!0;case"google.protobuf.Duration":return DTe(e.message,t),!0;case"google.protobuf.FieldMask":return OTe(e.message,t),!0;case"google.protobuf.Struct":return zZ(e.message,t),!0;case"google.protobuf.Value":return w5(e.message,t),!0;case"google.protobuf.ListValue":return YZ(e.message,t),!0;default:if(dy(e.desc)){const r=e.desc.fields[0];return t===null?e.clear(r):e.set(r,S5(r,t)),!0}return!1}}function kTe(e,t,n){var r;if(t===null||Array.isArray(t)||typeof t!="object")throw new Error(`cannot decode message ${e.$typeName} from JSON: expected object but got ${$i(t)}`);if(Object.keys(t).length==0)return;const i=t["@type"];if(typeof i!="string"||i=="")throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is empty`);const o=i.includes("/")?i.substring(i.lastIndexOf("/")+1):i;if(!o.length)throw new Error(`cannot decode message ${e.$typeName} from JSON: "@type" is invalid`);const a=(r=n.registry)===null||r===void 0?void 0:r.getMessage(o);if(!a)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${i} is not in the type registry`);const s=xl(a);if(wZ(a)&&Object.prototype.hasOwnProperty.call(t,"value")){const l=t.value;M1(s,l,n)}else{const l=Object.assign({},t);delete l["@type"],M1(s,l,n)}Xxe(s.desc,s.message,e)}function PTe(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${$i(t)}`);const n=t.match(/^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]{1,9}))?(?:Z|([+-][0-9][0-9]:[0-9][0-9]))$/);if(!n)throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);const r=Date.parse(n[1]+"-"+n[2]+"-"+n[3]+"T"+n[4]+":"+n[5]+":"+n[6]+(n[8]?n[8]:"Z"));if(Number.isNaN(r))throw new Error(`cannot decode message ${e.$typeName} from JSON: invalid RFC 3339 string`);if(rDate.parse("9999-12-31T23:59:59Z"))throw new Error(`cannot decode message ${e.$typeName} from JSON: must be from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z inclusive`);e.seconds=kr.parse(r/1e3),e.nanos=0,n[7]&&(e.nanos=parseInt("1"+n[7]+"0".repeat(9-n[7].length))-1e9)}function DTe(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${$i(t)}`);const n=t.match(/^(-?[0-9]+)(?:\.([0-9]+))?s/);if(n===null)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${$i(t)}`);const r=Number(n[1]);if(r>315576e6||r<-315576e6)throw new Error(`cannot decode message ${e.$typeName} from JSON: ${$i(t)}`);if(e.seconds=kr.parse(r),typeof n[2]!="string")return;const i=n[2]+"0".repeat(9-n[2].length);e.nanos=parseInt(i),(r<0||Object.is(r,-0))&&(e.nanos=-e.nanos)}function OTe(e,t){if(typeof t!="string")throw new Error(`cannot decode message ${e.$typeName} from JSON: ${$i(t)}`);t!==""&&(e.paths=t.split(",").map(n=>{if(n.includes("_"))throw new Error(`cannot decode message ${e.$typeName} from JSON: path names must be lowerCamelCase`);return QK(n)}))}function zZ(e,t){if(typeof t!="object"||t==null||Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${$i(t)}`);for(const[n,r]of Object.entries(t)){const i=Vs(FZ);w5(i,r),e.fields[n]=i}}function w5(e,t){switch(typeof t){case"number":e.kind={case:"numberValue",value:t};break;case"string":e.kind={case:"stringValue",value:t};break;case"boolean":e.kind={case:"boolValue",value:t};break;case"object":if(t===null)e.kind={case:"nullValue",value:AO.NULL_VALUE};else if(Array.isArray(t)){const n=Vs(eTe);YZ(n,t),e.kind={case:"listValue",value:n}}else{const n=Vs(qxe);zZ(n,t),e.kind={case:"structValue",value:n}}break;default:throw new Error(`cannot decode message ${e.$typeName} from JSON ${$i(t)}`)}return e}function YZ(e,t){if(!Array.isArray(t))throw new Error(`cannot decode message ${e.$typeName} from JSON ${$i(t)}`);for(const n of t){const r=Vs(FZ);w5(r,n),e.values.push(r)}}function e6(e){const t=An[e];return typeof t!="string"?e.toString():t[0].toLowerCase()+t.substring(1).replace(/[A-Z]/g,n=>"_"+n.toLowerCase())}class pr extends Error{constructor(t,n=An.Unknown,r,i,o){super(LTe(t,n)),this.name="ConnectError",Object.setPrototypeOf(this,new.target.prototype),this.rawMessage=t,this.code=n,this.metadata=new Headers(r??{}),this.details=i??[],this.cause=o}static from(t,n=An.Unknown){return t instanceof pr?t:t instanceof Error?t.name=="AbortError"||t.name=="TimeoutError"?new pr(t.message,An.Canceled):new pr(t.message,n,void 0,void 0,t):new pr(String(t),n,void 0,void 0,t)}static[Symbol.hasInstance](t){return t instanceof Error?Object.getPrototypeOf(t)===pr.prototype?!0:t.name==="ConnectError"&&"code"in t&&typeof t.code=="number"&&"metadata"in t&&"details"in t&&Array.isArray(t.details)&&"rawMessage"in t&&typeof t.rawMessage=="string"&&"cause"in t:!1}findDetails(t){const n=t.kind==="message"?{getMessage:i=>i===t.typeName?t:void 0}:t,r=[];for(const i of this.details){if("desc"in i){n.getMessage(i.desc.typeName)&&r.push(Vs(i.desc,i.value));continue}const o=n.getMessage(i.type);if(o)try{r.push(hy(o,i.value))}catch{}}return r}}function LTe(e,t){return e.length?`[${e6(t)}] ${e}`:`[${e6(t)}]`}function NTe(e,t,n){try{const r=t5(e);return t?hy(t,r,n):r}catch(r){throw pr.from(r,An.DataLoss)}}function MTe(e,t){const n={};for(const r of e.methods){const i=t(r);i!=null&&(n[r.localName]=i)}return n}const t6=1;function FTe(e,t,n=!1){if(t>e){let r=`message size is larger than configured readMaxBytes ${e}`;throw n&&(r=`message size ${t} is larger than configured readMaxBytes ${e}`),new pr(r,An.ResourceExhausted)}}function $Te(e){return new BTe(e)}class BTe{constructor(t){this.readMaxBytes=t,this.header=new Uint8Array(5),this.headerView=new DataView(this.header.buffer),this.buf=[]}get byteLength(){return this.buf.reduce((t,n)=>t+n.byteLength,0)}decode(t){this.buf.push(t);const n=[];for(;;){let r=this.pop();if(!r)break;n.push(r)}return n}pop(){if(!(!this.env&&(this.env=this.head(),!this.env))&&this.cons(this.env.data)){const t=this.env;return this.env=void 0,t}}head(){if(!this.cons(this.header))return;const t=this.headerView.getUint8(0),n=this.headerView.getUint32(1);return FTe(this.readMaxBytes,n,!0),{flags:t,data:new Uint8Array(n)}}cons(t){const n=t.byteLength;if(this.byteLengthn-r?(t.set(i.subarray(0,n-r),r),this.buf.unshift(i.subarray(n-r)),r+=n-r):(t.set(i,r),r+=i.byteLength)}return!0}}function n6(e){let t;const n=$Te(4294967295);return new ReadableStream({start(){t=e.getReader()},async pull(r){let i=!1;for(;!i;){const o=await t.read();if(o.done)n.byteLength>0&&r.error(new pr("protocol error: incomplete envelope",An.InvalidArgument)),r.close();else for(const a of n.decode(o.value))r.enqueue(a),i=!0}}})}function r6(e,t){const n=new Uint8Array(t.length+5);n.set(t,5);const r=new DataView(n.buffer,n.byteOffset,n.byteLength);return r.setUint8(0,e),r.setUint32(1,t.length),n}var VTe=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}},F1=function(e){return this instanceof F1?(this.v=e,this):new F1(e)},UTe=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(d){return function(p){return Promise.resolve(p).then(d,f)}}function s(d,p){r[d]&&(i[d]=function(v){return new Promise(function(y,m){o.push([d,v,y,m])>1||l(d,v)})},p&&(i[d]=p(i[d])))}function l(d,p){try{u(r[d](p))}catch(v){h(o[0][3],v)}}function u(d){d.value instanceof F1?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){l("next",d)}function f(d){l("throw",d)}function h(d,p){d(p),o.shift(),o.length&&l(o[0][0],o[0][1])}},GTe=function(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:F1(e[i](a)),done:!1}:o?o(a):a}:o}};function HTe(e){return UTe(this,arguments,function*(){yield F1(yield*GTe(VTe(e)))})}var jZ=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values=="function"?__values(e):e[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(o){n[o]=e[o]&&function(a){return new Promise(function(s,l){a=e[o](a),i(s,l,a.done,a.value)})}}function i(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}},_m=function(e){return this instanceof _m?(this.v=e,this):new _m(e)},WTe=function(e){var t,n;return t={},r("next"),r("throw",function(i){throw i}),r("return"),t[Symbol.iterator]=function(){return this},t;function r(i,o){t[i]=e[i]?function(a){return(n=!n)?{value:_m(e[i](a)),done:!1}:o?o(a):a}:o}},zTe=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(d){return function(p){return Promise.resolve(p).then(d,f)}}function s(d,p){r[d]&&(i[d]=function(v){return new Promise(function(y,m){o.push([d,v,y,m])>1||l(d,v)})},p&&(i[d]=p(i[d])))}function l(d,p){try{u(r[d](p))}catch(v){h(o[0][3],v)}}function u(d){d.value instanceof _m?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){l("next",d)}function f(d){l("throw",d)}function h(d,p){d(p),o.shift(),o.length&&l(o[0][0],o[0][1])}};function XZ(e,t){return MTe(e,n=>{switch(n.methodKind){case"unary":return YTe(t,n);case"server_streaming":return jTe(t,n);case"client_streaming":return XTe(t,n);case"bidi_streaming":return KTe(t,n);default:return null}})}function YTe(e,t){return async(n,r)=>{var i,o;const a=await e.unary(t,r?.signal,r?.timeoutMs,r?.headers,n,r?.contextValues);return(i=r?.onHeader)===null||i===void 0||i.call(r,a.header),(o=r?.onTrailer)===null||o===void 0||o.call(r,a.trailer),a.message}}function jTe(e,t){return(n,r)=>KZ(e.stream(t,r?.signal,r?.timeoutMs,r?.headers,HTe([n]),r?.contextValues),r)}function XTe(e,t){return async(n,r)=>{var i,o,a,s,l,u;const c=await e.stream(t,r?.signal,r?.timeoutMs,r?.headers,n,r?.contextValues);(l=r?.onHeader)===null||l===void 0||l.call(r,c.header);let f,h=0;try{for(var d=!0,p=jZ(c.message),v;v=await p.next(),i=v.done,!i;d=!0)s=v.value,d=!1,f=s,h++}catch(y){o={error:y}}finally{try{!d&&!i&&(a=p.return)&&await a.call(p)}finally{if(o)throw o.error}}if(!f)throw new pr("protocol error: missing response message",An.Unimplemented);if(h>1)throw new pr("protocol error: received extra messages for client streaming method",An.Unimplemented);return(u=r?.onTrailer)===null||u===void 0||u.call(r,c.trailer),f}}function KTe(e,t){return(n,r)=>KZ(e.stream(t,r?.signal,r?.timeoutMs,r?.headers,n,r?.contextValues),r)}function KZ(e,t){const n=(function(){return zTe(this,arguments,function*(){var r,i;const o=yield _m(e);(r=t?.onHeader)===null||r===void 0||r.call(t,o.header),yield _m(yield*WTe(jZ(o.message))),(i=t?.onTrailer)===null||i===void 0||i.call(t,o.trailer)})})()[Symbol.asyncIterator]();return{[Symbol.asyncIterator]:()=>({next:()=>n.next()})}}function ZTe(...e){const t=new AbortController,n=e.filter(i=>i!==void 0).concat(t.signal);for(const i of n){if(i.aborted){r.apply(i);break}i.addEventListener("abort",r)}function r(){t.signal.aborted||t.abort(ZZ(this));for(const i of n)i.removeEventListener("abort",r)}return t}function JTe(e){const t=new AbortController,n=()=>{t.abort(new pr("the operation timed out",An.DeadlineExceeded))};let r;return e!==void 0&&(e<=0?n():r=setTimeout(n,e)),{signal:t.signal,cleanup:()=>clearTimeout(r)}}function ZZ(e){if(!e.aborted)return;if(e.reason!==void 0)return e.reason;const t=new Error("This operation was aborted");return t.name="AbortError",t}function i6(){return{get(e){return e.id in this?this[e.id]:e.defaultValue},set(e,t){return this[e.id]=t,this},delete(e){return delete this[e.id],this}}}const qR=128;function o6(e){const t=new Headers,n=new TextDecoder().decode(e).split(`\r +`);for(const r of n){if(r==="")continue;const i=r.indexOf(":");if(i>0){const o=r.substring(0,i).trim(),a=r.substring(i+1).trim();t.append(o,a)}}return t}const QTe="Content-Type",qTe="Grpc-Timeout",Sm="Grpc-Status",JZ="Grpc-Message",eEe="Grpc-Status-Details-Bin",tEe="User-Agent",a6="X-User-Agent",nEe="X-Grpc-Web",rEe="application/grpc-web+proto",iEe="application/grpc-web+json",oEe=q_("CgxzdGF0dXMucHJvdG8SCmdvb2dsZS5ycGMiTgoGU3RhdHVzEgwKBGNvZGUYASABKAUSDwoHbWVzc2FnZRgCIAEoCRIlCgdkZXRhaWxzGAMgAygLMhQuZ29vZ2xlLnByb3RvYnVmLkFueUJeCg5jb20uZ29vZ2xlLnJwY0ILU3RhdHVzUHJvdG9QAVo3Z29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xlYXBpcy9ycGMvc3RhdHVzO3N0YXR1c6ICA1JQQ2IGcHJvdG8z",[NZ]),aEe=Pu(oEe,0),sEe="0";function QZ(e){var t;const n=e.get(eEe);if(n!=null){const i=NTe(n,aEe);if(i.code==0)return;const o=new pr(i.message,i.code,e);return o.details=i.details.map(a=>({type:a.typeUrl.substring(a.typeUrl.lastIndexOf("/")+1),value:a.value})),o}const r=e.get(Sm);if(r!=null){if(r===sEe)return;const i=parseInt(r,10);return i in An?new pr(decodeURIComponent((t=e.get(JZ))!==null&&t!==void 0?t:""),i,e):new pr(`invalid grpc-status: ${r}`,An.Internal,e)}}function s6(e,t){return e.toString().replace(/\/?$/,`/${t.parent.typeName}/${t.name}`)}function qZ(e,t){return Vs(e,t)}function lEe(e,t){function n(r){return r.done===!0?r:{done:r.done,value:qZ(e,r.value)}}return{[Symbol.asyncIterator](){const r=t[Symbol.asyncIterator](),i={next:()=>r.next().then(n)};return r.throw!==void 0&&(i.throw=o=>r.throw(o).then(n)),r.return!==void 0&&(i.return=o=>r.return(o).then(n)),i}}}function eJ(e,t){if(!t)return e;for(const n of t.concat().reverse())e=n(e);return e}function uEe(e){var t;const n=Object.assign({},e);return(t=n.ignoreUnknownFields)!==null&&t!==void 0||(n.ignoreUnknownFields=!0),n}function l6(e,t,n,r){const i=t?u6(e.input,r):c6(e.input,n);return{parse:(t?u6(e.output,r):c6(e.output,n)).parse,serialize:i.serialize}}function u6(e,t){return{parse(n){try{return hy(e,n,t)}catch(r){const i=r instanceof Error?r.message:String(r);throw new pr(`parse binary: ${i}`,An.Internal)}},serialize(n){try{return v5(e,n,t)}catch(r){const i=r instanceof Error?r.message:String(r);throw new pr(`serialize binary: ${i}`,An.Internal)}}}}function c6(e,t){var n,r;const i=(n=t?.textEncoder)!==null&&n!==void 0?n:new TextEncoder,o=(r=t?.textDecoder)!==null&&r!==void 0?r:new TextDecoder,a=uEe(t);return{parse(s){try{const l=o.decode(s);return bTe(e,l,a)}catch(l){throw pr.from(l,An.InvalidArgument)}},serialize(s){try{const l=cTe(e,s,a);return i.encode(l)}catch(l){throw pr.from(l,An.Internal)}}}}function cEe(e){const t=eJ(e.next,e.interceptors),[n,r,i]=tJ(e),o=Object.assign(Object.assign({},e.req),{message:qZ(e.req.method.input,e.req.message),signal:n});return t(o).then(a=>(i(),a),r)}function fEe(e){const t=eJ(e.next,e.interceptors),[n,r,i]=tJ(e),o=Object.assign(Object.assign({},e.req),{message:lEe(e.req.method.input,e.req.message),signal:n});let a=!1;return n.addEventListener("abort",function(){var s,l;const u=e.req.message[Symbol.asyncIterator]();a||(s=u.throw)===null||s===void 0||s.call(u,this.reason).catch(()=>{}),(l=u.return)===null||l===void 0||l.call(u).catch(()=>{})}),t(o).then(s=>Object.assign(Object.assign({},s),{message:{[Symbol.asyncIterator](){const l=s.message[Symbol.asyncIterator]();return{next(){return l.next().then(u=>(u.done==!0&&(a=!0,i()),u),r)}}}}}),r)}function tJ(e){const{signal:t,cleanup:n}=JTe(e.timeoutMs),r=ZTe(e.signal,t);return[r.signal,function(o){const a=r.signal.aborted?pr.from(ZZ(r.signal),An.Canceled):pr.from(o);return r.abort(a),n(),Promise.reject(a)},function(){n(),r.abort()}]}function dEe(){try{new Headers}catch{throw new Error("connect-web requires the fetch API. Are you running on an old version of Node.js? Node.js is not supported in Connect for Web - please stay tuned for Connect for Node.")}}function f6(e,t){const n=QZ(e);if(n)throw t.forEach((r,i)=>{n.metadata.append(i,r)}),n;if(!t.has(Sm)&&!e.has(Sm))throw new pr("protocol error: missing status",An.Internal)}function d6(e,t,n,r){var i,o;const a=new Headers(n??{});a.set(QTe,e?rEe:iEe),a.set(nEe,"1");const s=(o=(i=a.get(tEe))!==null&&i!==void 0?i:a.get(a6))!==null&&o!==void 0?o:"connect-es/2.1.2";return a.set(a6,s),t!==void 0&&a.set(qTe,`${t}m`),a}function hEe(e){switch(e){case 400:return An.Internal;case 401:return An.Unauthenticated;case 403:return An.PermissionDenied;case 404:return An.Unimplemented;case 429:return An.Unavailable;case 502:return An.Unavailable;case 503:return An.Unavailable;case 504:return An.Unavailable;default:return An.Unknown}}function h6(e,t){var n;if(e>=200&&e<300)return{foundStatus:t.has(Sm),headerError:QZ(t)};throw new pr(decodeURIComponent((n=t.get(JZ))!==null&&n!==void 0?n:`HTTP ${e}`),hEe(e),t)}var Yh=function(e){return this instanceof Yh?(this.v=e,this):new Yh(e)},pEe=function(e,t,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),i[Symbol.asyncIterator]=function(){return this},i;function a(d){return function(p){return Promise.resolve(p).then(d,f)}}function s(d,p){r[d]&&(i[d]=function(v){return new Promise(function(y,m){o.push([d,v,y,m])>1||l(d,v)})},p&&(i[d]=p(i[d])))}function l(d,p){try{u(r[d](p))}catch(v){h(o[0][3],v)}}function u(d){d.value instanceof Yh?Promise.resolve(d.value.v).then(c,f):h(o[0][2],d)}function c(d){l("next",d)}function f(d){l("throw",d)}function h(d,p){d(p),o.shift(),o.length&&l(o[0][0],o[0][1])}};const p6={redirect:"error"};function nJ(e){var t;dEe();const n=(t=e.useBinaryFormat)!==null&&t!==void 0?t:!0;return{async unary(r,i,o,a,s,l){const{serialize:u,parse:c}=l6(r,n,e.jsonOptions,e.binaryOptions);return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,await cEe({interceptors:e.interceptors,signal:i,timeoutMs:o,req:{stream:!1,service:r.parent,method:r,requestMethod:"POST",url:s6(e.baseUrl,r),header:d6(n,o,a),contextValues:l??i6(),message:s},next:async f=>{var h;const p=await((h=e.fetch)!==null&&h!==void 0?h:globalThis.fetch)(f.url,Object.assign(Object.assign({},p6),{method:f.requestMethod,headers:f.header,signal:f.signal,body:r6(0,u(f.message))})),{headerError:v}=h6(p.status,p.headers);if(!p.body)throw v!==void 0?v:"missing response body";const y=n6(p.body).getReader();let m,b;for(;;){const S=await y.read();if(S.done)break;const{flags:w,data:x}=S.value;if((w&t6)===t6)throw new pr("protocol error: received unsupported compressed output",An.Internal);if(w===qR){if(m!==void 0)throw"extra trailer";m=o6(x);continue}if(b!==void 0)throw new pr("extra message",An.Unimplemented);b=c(x)}if(m===void 0)throw v!==void 0?v:new pr("missing trailer",p.headers.has(Sm)?An.Unimplemented:An.Unknown);if(f6(m,p.headers),b===void 0)throw new pr("missing message",m.has(Sm)?An.Unimplemented:An.Unknown);return{stream:!1,service:r.parent,method:r,header:p.headers,message:b,trailer:m}}})},async stream(r,i,o,a,s,l){const{serialize:u,parse:c}=l6(r,n,e.jsonOptions,e.binaryOptions);function f(d,p,v,y,m){return pEe(this,arguments,function*(){const S=n6(d).getReader();if(p){if(!(yield Yh(S.read())).done)throw"extra data for trailers-only";return yield Yh(void 0)}let w=!1;for(;;){const x=yield Yh(S.read());if(x.done)break;const{flags:T,data:C}=x.value;if((T&qR)===qR){if(w)throw"extra trailer";w=!0;const P=o6(C);f6(P,y),P.forEach((k,L)=>v.set(L,k));continue}if(w)throw"extra message";yield yield Yh(c(C))}if("throwIfAborted"in m&&m.throwIfAborted(),!w)throw"missing trailer"})}async function h(d){if(r.methodKind!="server_streaming")throw"The fetch API does not support streaming request bodies";const p=await d[Symbol.asyncIterator]().next();if(p.done==!0)throw"missing request message";return r6(0,u(p.value))}return o=o===void 0?e.defaultTimeoutMs:o<=0?void 0:o,fEe({interceptors:e.interceptors,signal:i,timeoutMs:o,req:{stream:!0,service:r.parent,method:r,requestMethod:"POST",url:s6(e.baseUrl,r),header:d6(n,o,a),contextValues:l??i6(),message:s},next:async d=>{var p;const y=await((p=e.fetch)!==null&&p!==void 0?p:globalThis.fetch)(d.url,Object.assign(Object.assign({},p6),{method:d.requestMethod,headers:d.header,signal:d.signal,body:await h(d.message)})),{foundStatus:m,headerError:b}=h6(y.status,y.headers);if(b!=null)throw b;if(!y.body)throw"missing response body";const S=new Headers;return Object.assign(Object.assign({},d),{header:y.headers,trailer:S,message:f(y.body,m,S,y.headers,d.signal)})}})}}}const rJ=e=>t=>n=>(e&&n.header.set("Authorization",`Bearer ${e}`),t(n));class iJ{client;constructor(t,n){this.client=XZ(y5,nJ({baseUrl:t,interceptors:n?[rJ(n)]:[]}))}}let f0=null;const vEe=e=>`${e.uuid}|${z_(e)}|${AI(e)}`,x5=()=>{const e=Sn.value,t=e?z_(e):"";if(!e||!t)return f0=null,null;const n=vEe(e);return f0?.key===n||(f0={key:n,client:new iJ(t,AI(e))}),f0.client},gEe=async(e,t=1e4)=>{const n=z_(e);if(!n)return!1;const r=AI(e),i=XZ(y5,nJ({baseUrl:n,interceptors:r?[rJ(r)]:[]})),o=new AbortController,a=setTimeout(()=>o.abort(),t);try{return await i.getVersion({},{signal:o.signal}),!0}catch{return!1}finally{clearTimeout(a)}},T5=Object.freeze(Object.defineProperty({__proto__:null,SingboxClient:iJ,getSingboxClient:x5,probeSingboxChannel:gEe},Symbol.toStringTag,{value:"Module"})),mEe=new Uint8Array([1]);class yEe{constructor(t){this.options=t;const n=t.baseUrl.replace(/^http/,"ws");this.socket=new WebSocket(`${n}/${t.service}/${t.method}`,["grpc-websockets"]),this.socket.binaryType="arraybuffer",this.socket.onopen=()=>{let r=`content-type: application/grpc-web+proto\r +x-grpc-web: 1\r +`;t.secret&&(r+=`authorization: Bearer ${t.secret}\r +`),this.socket.send(new TextEncoder().encode(r)),this.opened=!0;for(const i of this.pendingSends)this.socket.send(i);this.pendingSends=[]},this.socket.onmessage=r=>{this.receive(new Uint8Array(r.data))},this.socket.onerror=()=>{this.end(null,"websocket connection failed")},this.socket.onclose=r=>{this.status?this.end(this.status):this.end(null,r.reason||"websocket closed unexpectedly")}}socket;buffer=new Uint8Array(0);pendingSends=[];opened=!1;ended=!1;headersSeen=!1;status=null;send(t){const n=v5(this.options.requestSchema,Vs(this.options.requestSchema,t)),r=new Uint8Array(6+n.length);r[2]=n.length>>>24&255,r[3]=n.length>>>16&255,r[4]=n.length>>>8&255,r[5]=n.length&255,r.set(n,6),this.enqueue(r)}finishSend(){this.enqueue(mEe)}close(){this.ended=!0,this.socket.close()}enqueue(t){this.opened?this.socket.readyState===WebSocket.OPEN&&this.socket.send(t):this.pendingSends.push(t)}end(t,n){this.ended||(this.ended=!0,this.socket.close(),this.options.onEnd(t,n))}receive(t){if(this.ended)return;const n=new Uint8Array(this.buffer.length+t.length);for(n.set(this.buffer),n.set(t,this.buffer.length),this.buffer=n;this.buffer.length>=5;){const r=this.buffer[0],i=(this.buffer[1]<<24|this.buffer[2]<<16|this.buffer[3]<<8|this.buffer[4])>>>0;if(this.buffer.length<5+i)return;const o=this.buffer.slice(5,5+i);if(this.buffer=this.buffer.slice(5+i),(r&128)!==0)this.receiveMetadata(o);else try{this.options.onMessage(hy(this.options.responseSchema,o))}catch(a){this.end(null,`decode response: ${String(a)}`);return}}}receiveMetadata(t){const n=new TextDecoder().decode(t),r={};for(const a of n.split(`\r +`)){const s=a.indexOf(":");s<=0||(r[a.slice(0,s).trim().toLowerCase()]=a.slice(s+1).trim())}if(!this.headersSeen&&!("grpc-status"in r)){this.headersSeen=!0;return}const i=Number(r["grpc-status"]??"2");let o=r["grpc-message"]??"";try{o=decodeURIComponent(o)}catch{}this.status={code:i,message:o},this.end(this.status)}}const d0=(e,t,n)=>({[Symbol.asyncIterator](){const r=Sn.value,i=r?z_(r):"";if(!r||!i)throw new Error("sing-box backend unavailable");const o=[];let a=!1,s=null,l=null;const u=()=>{l?.(),l=null},c=new yEe({baseUrl:i,secret:AI(r),service:e.parent.typeName,method:e.name,requestSchema:e.input,responseSchema:e.output,onMessage:d=>{o.push(d),u()},onEnd:(d,p)=>{a=!0,p?s=p:d&&d.code!==0&&(s=`grpc-status ${d.code}: ${d.message}`),u()}});c.send(t),c.finishSend();const f=()=>{a=!0,c.close(),u()};n.addEventListener("abort",f,{once:!0});const h=()=>(n.removeEventListener("abort",f),c.close(),{value:void 0,done:!0});return{async next(){for(;;){if(o.length)return{value:o.shift(),done:!1};if(a){const d=h();if(s&&!n.aborted)throw new Error(s);return d}await new Promise(d=>{l=d})}},async return(){return a=!0,h()}}}}),bEe=(e,t,n={})=>{let r=null,i=!1,o=0;return(async()=>{for(;!i;){r=new AbortController;try{for await(const l of e(r.signal)){if(i)return;n.resetBackoffOnMessage!==!1&&(o=0),t(l)}}catch(l){if(i)return;n.onError?.(l)}if(i)return;const s=Math.min(1e3*2**o,15e3);o+=1,await new Promise(l=>setTimeout(l,s))}})(),{close:()=>{i=!0,r?.abort()}}},v6=1000000000n,{method:h0}=y5,_Ee={logs:e=>d0(h0.subscribeLog,{},e),connections:e=>d0(h0.subscribeConnections,{interval:v6},e),status:e=>d0(h0.subscribeStatus,{interval:v6},e),groups:e=>d0(h0.subscribeGroups,{},e),outbounds:e=>d0(h0.subscribeOutbounds,{},e)},E5=(e,t)=>bEe(_Ee[e],t),SEe=()=>{const e=me(),t=new Map;let n=[],r=null;const i=(u,c,f)=>Object.assign({},u,{downloadSpeed:c,uploadSpeed:f}),o=(u,c)=>{const f=c??t.get(u);t.delete(u),f&&n.push(i(f,0,0))},a=()=>{r=null,e.value={active:Array.from(t.values()),closed:n},n=[]},s=()=>{r||(r=setTimeout(a,100))},l=E5("connections",u=>{u.reset&&t.clear();for(const c of u.events){const f=Number(c.downlinkDelta),h=Number(c.uplinkDelta);switch(c.type){case DT.CONNECTION_EVENT_NEW:c.connection&&(c.connection.closedAt>0n?o(c.id,c.connection):t.set(c.id,i(c.connection,0,0)));break;case DT.CONNECTION_EVENT_UPDATE:{if(c.connection)c.connection.closedAt>0n?o(c.id,c.connection):t.set(c.id,i(c.connection,f,h));else{const d=t.get(c.id);if(d){const p=ui(d);t.set(c.id,i({...p,uplinkTotal:p.uplinkTotal+c.uplinkDelta,downlinkTotal:p.downlinkTotal+c.downlinkDelta},f,h))}}break}case DT.CONNECTION_EVENT_CLOSED:{o(c.id,c.connection);break}}}s()});return{data:e,close:()=>{r&&clearTimeout(r),l.close()}}},wEe=async e=>{const t=x5()?.client;t&&await t.closeConnection({id:e})},xEe=async()=>{const e=x5()?.client;e&&await e.closeAllConnections({})},TEe=wEe,EEe=xEe,CEe=SEe,vg=e=>{if(!e)return["",""];const t=e.lastIndexOf(":");if(t===-1)return[e,""];let n=e.slice(0,t);const r=e.slice(t+1);return n.startsWith("[")&&n.endsWith("]")&&(n=n.slice(1,-1)),[n,r]},ui=e=>e,g6=e=>{const[,t]=vg(e.destination);return(t==="443"||e.domain)&&e.network==="udp"?"quic":e.network},m6=e=>e.domain||vg(e.destination)[0],C5={chains:e=>{const t=ui(e);return t.chainList.length?t.chainList:[t.outbound].filter(Boolean)},download:e=>Number(ui(e).downlinkTotal),upload:e=>Number(ui(e).uplinkTotal),start:e=>Number(ui(e).createdAt),rule:e=>ui(e).rule,rulePayload:()=>"",sourceIP:e=>vg(ui(e).source)[0],sourcePort:e=>vg(ui(e).source)[1],network:e=>g6(ui(e)),networkType:e=>{const t=ui(e);return`${t.inboundType} | ${g6(t)}`},hostname:e=>m6(ui(e)),host:e=>{const t=ui(e),[,n]=vg(t.destination),r=m6(t);return r.includes(":")?`[${r}]:${n}`:`${r}:${n}`},process:e=>(ui(e).processInfo?.processPath??"").replace(/^.*[/\\](.*)$/,"$1")||"-",destination:e=>{const t=ui(e);return vg(t.destination)[0]||t.domain},inboundUser:e=>{const t=ui(e);return t.user||t.inbound||"-"},sniffHost:e=>ui(e).domain,remoteAddress:e=>ui(e).destination,protocol:e=>ui(e).protocol,outboundType:e=>ui(e).outboundType,fromOutbound:e=>ui(e).fromOutbound,smartBlock:()=>{}},IEe=ZM(C5),AEe=JK(C5),REe=Object.freeze(Object.defineProperty({__proto__:null,connectionAccessor:C5,disconnectAllAPI:EEe,disconnectByIdAPI:TEe,fetchConnectionsAPI:CEe,getConnectionDisplayValue:IEe,getConnectionVisibleSearchValues:AEe},Symbol.toStringTag,{value:"Module"})),py=()=>Vi.value?REe:Iwe,vy=e=>py().disconnectByIdAPI(e),kEe=()=>py().disconnectAllAPI(),PEe=()=>py().fetchConnectionsAPI(),na=()=>py().connectionAccessor,I5=(e,t,n)=>py().getConnectionDisplayValue(e,t,n),DEe=(e,t,n)=>py().getConnectionVisibleSearchValues(e,t,n),oJ=e=>{const t=or.value[e];return t?t.all?.length?!0:[Uo.Dns,Uo.Compatible,Uo.Direct,Uo.Reject,Uo.RejectDrop,Uo.Pass,Uo.Fallback,Uo.URLTest,Uo.LoadBalance,Uo.Selector,Uo.Smart].includes(t.type.toLowerCase()):!1},xu=e=>na().chains(e),wm=e=>na().download(e),xm=e=>na().upload(e),$1=e=>na().start(e),RO=e=>na().rule(e),OEe=e=>na().rulePayload(e),fd=e=>na().sourceIP(e),LEe=e=>na().network(e),aJ=e=>na().smartBlock(e),NEe=e=>na().hostname(e),y6=e=>na().host(e),MEe=e=>na().process(e),FEe=e=>na().destination(e),b6=e=>na().networkType(e),_6=e=>na().inboundUser(e),S6=e=>{const t=[...xu(e)];return cu.value===Xp.NORMAL&&t.reverse(),t.join("")},A5=(e,t)=>{const{suffix:n="",binary:r=!1}=t;return e.data.init?"":` +
+
+ ${e.seriesName} + (${Br(e.data.name).format("HH:mm:ss")}): ${yn(e.data.value[1],{binary:r})}${n} +
`},B1=e=>e===Is?"":e{const e=YM.value,t={[un.rules]:e.rules,[un.tools]:e.tools};return Object.values(un).filter(n=>!(n===un.setup||!tb.value&&n===un.overview||n in t&&t[n]===!1))}),sJ=()=>{document.querySelectorAll(".custom-theme").forEach(e=>{e.remove()}),lm.value.forEach(e=>{const t=document.createElement("style"),n=Object.entries(e).filter(([r])=>!["prefersdark","default","name","type","id"].includes(r)).map(([r,i])=>`${r}:${i}`).join(";");t.innerHTML=`[data-theme="${e.name}"] { + ${n} + }`,t.className=`custom-theme ${e.name}`,document.head.appendChild(t)})},$Ee=()=>{if(window.ksu){const e=document.createElement("link");e.rel="stylesheet",e.href="https://mui.kernelsu.org/internal/colors.css",document.head.appendChild(e)}},R5=e=>Reflect.has(jE.value,e)?jE.value[e]:or.value[e]?.hidden,lJ=()=>{tr({content:"upgradeSuccess",type:"alert-success"})};var ei=(e=>(e.TOGGLE_SIDEBAR="sidebar:toggle",e.TOGGLE_MANAGE_HIDDEN_GROUP="proxies:toggle-manage-hidden-group",e.BACKEND_PREVIOUS="backend:previous",e.BACKEND_NEXT="backend:next",e.BACKEND_OPEN_SETTINGS="backend:open-settings",e.PAGE_1="page:1",e.PAGE_2="page:2",e.PAGE_3="page:3",e.PAGE_4="page:4",e.PAGE_5="page:5",e.PAGE_6="page:6",e))(ei||{});const BEe=["page:1","page:2","page:3","page:4","page:5","page:6"],kO={"page:1":0,"page:2":1,"page:3":2,"page:4":3,"page:5":4,"page:6":5},Of={"sidebar:toggle":{defaultKey:"B",label:"toggleSidebar"},"proxies:toggle-manage-hidden-group":{defaultKey:"H",label:"manageHiddenGroup"},"backend:previous":{defaultKey:"P",label:"switchToPreviousBackend"},"backend:next":{defaultKey:"N",label:"switchToNextBackend"},"backend:open-settings":{defaultKey:"S",label:"openBackendSettings"},"page:1":{defaultKey:"1",label:"keyboardShortcutPageName"},"page:2":{defaultKey:"2",label:"keyboardShortcutPageName"},"page:3":{defaultKey:"3",label:"keyboardShortcutPageName"},"page:4":{defaultKey:"4",label:"keyboardShortcutPageName"},"page:5":{defaultKey:"5",label:"keyboardShortcutPageName"},"page:6":{defaultKey:"6",label:"keyboardShortcutPageName"}},uJ=e=>{if(e===" ")return"Space";const t=e.trim();return t?t.length===1?t.toUpperCase():t:""},VEe=e=>["Control","Meta","Alt","Shift"].includes(e),w6=e=>{if(!e)return"";const t=e.split("+").map(o=>o.trim()).filter(Boolean);if(!t.length)return"";const n=new Set(t),r=["Ctrl","Meta","Alt","Shift"].filter(o=>n.has(o)),i=t.find(o=>!["Ctrl","Meta","Alt","Shift"].includes(o))||"";return i?[...r,uJ(i)].join("+"):""},cJ=e=>VEe(e.key)?"":[...[e.ctrlKey?"Ctrl":"",e.metaKey?"Meta":"",e.altKey?"Alt":"",e.shiftKey?"Shift":""].filter(Boolean),uJ(e.key)].join("+"),Ah=e=>Of[e]?.defaultKey??"",fJ=()=>{const e=ae(()=>Object.fromEntries(Object.entries(Ch.value).map(([n,r])=>[n,w6(r)])));return{getShortcutKey:n=>n in e.value?e.value[n]:w6(Ah(n))}},UEe=()=>{const e=Z_(),{getShortcutKey:t}=fJ(),n=ae(()=>{const i=new Map,o=Object.keys(Of);for(const a of o){const s=t(a);!s||i.has(s)||i.set(s,a)}return i}),r=i=>{const o=i.target;if(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o?.isContentEditable)return;const a=cJ(i),s=n.value.get(a);if(!s)return;if(s==="sidebar:toggle"){i.preventDefault(),bo.value=!bo.value;return}if(s==="proxies:toggle-manage-hidden-group"){i.preventDefault(),xp.value=!xp.value;return}if(s==="backend:previous"||s==="backend:next"){if(!Sn.value)return;i.preventDefault();const f=F0e(s==="backend:next"?1:-1);f&&tr({content:"backendSwitchTo",params:{backend:$c(f)},type:"alert-success"});return}if(s==="backend:open-settings"){i.preventDefault(),M0e();return}if(!Sn.value)return;const l=kO[s];if(typeof l!="number")return;const u=iu.value[l];u&&(i.preventDefault(),e.push({name:u}))};return Sr(()=>{document.addEventListener("keydown",r)}),Do(()=>{document.removeEventListener("keydown",r)}),{getShortcutKey:t}},GEe=()=>Vi.value?Promise.reject("unsupported"):OSe(),HEe=e=>Vi.value?Promise.resolve():LSe(e),WEe=()=>Vi.value?Promise.resolve():NSe(),k5="config/import-settings-url",PO="./zashboard-settings.json",ag=Qe(k5,PO),OT=Qe("config/auto-import-settings",!1),gg=Qe("config/auto-sync-settings",!1),ek=Qe("cache/auto-import-settings-hash",""),tk=Qe("cache/auto-sync-settings-hash",""),dJ=async e=>{const n=Object.keys(e).sort().map(i=>`${i}:${e[i]}`).join("|");let r=0;for(let i=0;i{if(e.length===0)return!1;const n=t==="syncSettingsConfirm"?"syncSettings":"importSettings";return rSe({title:dm.global.t(n),message:dm.global.t(t,{keys:e.join(` +`)})})},zEe=e=>Object.keys(e).filter(t=>t.startsWith("config/")&&localStorage.getItem(t)!==e[t]),QE=async({force:e=!1,notify:t=!1,confirm:n=!0}={})=>{const{data:r}=await GEe();if(!r||Jn.isEmpty(r))return!1;r["config/auto-sync-settings"]=JSON.stringify(gg.value);const i=await dJ(r);return!e&&tk.value===i?!1:n&&!await hJ(zEe(r),"syncSettingsConfirm")?(tk.value=i,!1):(EX(r),tk.value=i,t&&tr({content:"syncSettingsSuccess",type:"alert-success"}),location.reload(),!0)},YEe=e=>Object.keys(e).filter(t=>t===k5&&!e[t]?!1:localStorage.getItem(t)!==e[t]),pJ=async({force:e=!1,confirm:t=!0}={})=>{const n=await fetch(ag.value),r=()=>{tr({content:"importFailed",params:{url:n.url},type:"alert-error"})};if(!n.ok)return r(),!1;let i={};try{i=await n.json()}catch{return r(),!1}if(!i)return r(),!1;const o=await dJ(i);if(o===ek.value&&!e)return!1;if(t&&!await hJ(YEe(i),"importSettingsConfirm"))return ek.value=o,!1;tr({content:"importing"}),ek.value=o;for(const a in i)a===k5&&!i[a]||localStorage.setItem(a,i[a]);return location.reload(),!0},vJ=e=>{const t=new Map,r=new Promise((f,h)=>{const d=indexedDB.open(e,1);d.onupgradeneeded=()=>{const p=d.result;p.objectStoreNames.contains(e)||p.createObjectStore(e,{keyPath:"key"})},d.onsuccess=()=>{const y=d.result.transaction(e,"readonly").objectStore(e).openCursor();y.onsuccess=m=>{const b=m.target.result;b?(t.set(b.key,b.value.value),b.continue()):f(d.result)},y.onerror=()=>h(y.error)},d.onerror=()=>h(d.error)}),i=async(f,h)=>{const d=await r;return new Promise((p,v)=>{const m=d.transaction(e,f).objectStore(e),b=h(m);b.onsuccess=()=>p(b.result),b.onerror=()=>v(b.error)})};return{put:async(f,h)=>(await r,t.set(f,h),i("readwrite",d=>d.put({key:f,value:h}))),get:async f=>(await r,t.get(f)),del:async f=>(await r,t.delete(f),i("readwrite",h=>h.delete(f))),getAllKeys:async()=>(await r,Array.from(t.keys())),isExists:async f=>(await r,t.has(f)),clear:async()=>(await r,t.clear(),i("readwrite",f=>f.clear()))}},P5=vJ("base64"),gJ="background-image",jEe=e=>P5.put(gJ,e),XEe=()=>P5.get(gJ),KEe=()=>P5.clear(),V1="local-image",ZEe=Br().format("YYYY-MM-DD"),mJ=me(""),JEe=async()=>{mJ.value=await XEe()||""};et(()=>Go.value,()=>{Go.value.includes(V1)&&JEe()},{immediate:!0});const Nb=ae(()=>Go.value?Go.value.includes(V1)?`background-image: url('${mJ.value}');`:`background-image: url('${Go.value}?v=${ZEe}');`:"");var ar=(e=>(e.SourceIP="sourceIP",e.Destination="destination",e.Process="process",e.Outbound="outbound",e))(ar||{});const D5=vJ("connection-history"),yJ=async(e,t,n)=>{const r=JSON.stringify(n);return D5.put(`${e}-${t}`,r)},QEe=async(e,t)=>{const n=await D5.get(`${e}-${t}`);if(!n)return[];try{return JSON.parse(n)}catch{return[]}},x6=async()=>D5.clear(),qEe=Ye({__name:"App",setup(e){const t=me(),n=me();E0e(n);const r={[ap.TWEMOJI]:{[go.MI_SANS]:"font-MiSans-Twemoji",[go.SARASA_UI]:"font-SarasaUI-Twemoji",[go.PING_FANG]:"font-PingFang-Twemoji",[go.FIRA_SANS]:"font-FiraSans-Twemoji",[go.SYSTEM_UI]:"font-SystemUI-Twemoji"},[ap.NOTO_COLOR_EMOJI]:{[go.MI_SANS]:"font-MiSans-NotoEmoji",[go.SARASA_UI]:"font-SarasaUI-NotoEmoji",[go.PING_FANG]:"font-PingFang-NotoEmoji",[go.FIRA_SANS]:"font-FiraSans-NotoEmoji",[go.SYSTEM_UI]:"font-SystemUI-NotoEmoji"}},i=ae(()=>r[eT.value]?.[Tc.value]||r[ap.TWEMOJI][go.SYSTEM_UI]),o=()=>{if(!t.value)return;const p=getComputedStyle(t.value).getPropertyValue("background-color").trim(),v=document.querySelector('meta[name="theme-color"]');v&&v.setAttribute("content",p)};et(xX,o),et(ud,()=>{document.body.setAttribute("data-theme",ud.value),o()},{immediate:!0});let a=0,s=0;const l=p=>{a=p.touches[0].clientX,s=p.touches[0].clientY},u=p=>{let v=p;for(;v&&v!==document.body&&v!==document.documentElement;){const{overflowY:y}=getComputedStyle(v);if((y==="auto"||y==="scroll")&&v.scrollHeight>v.clientHeight)return v;v=v.parentElement}return null},c=p=>{if(p.touches.length>1)return;const v=p.touches[0].clientX-a,y=p.touches[0].clientY-s;if(Math.abs(y)<=Math.abs(v))return;const m=u(p.target);if(!m){p.preventDefault();return}const b=m.scrollTop<=0,S=m.scrollTop+m.clientHeight>=m.scrollHeight-1;(b&&y>0||S&&y<0)&&p.preventDefault()};et(Tb,()=>{const p=document.body;Tb.value?(p.style.overscrollBehavior="none",p.style.overflow="hidden",document.addEventListener("touchstart",l,{passive:!0}),document.addEventListener("touchmove",c,{passive:!1})):(p.style.overscrollBehavior="",p.style.overflow="",document.removeEventListener("touchstart",l),document.removeEventListener("touchmove",c))},{immediate:!0});const f=(p,v)=>p.host===v.host&&p.port===v.port&&p.password===v.password&&p.protocol===v.protocol&&p.secondaryPath===v.secondaryPath&&p.disableUpgradeCore===v.disableUpgradeCore&&p.disableTunMode===v.disableTunMode;(()=>{const p=CX();if(p){for(const v of Vn.value)if(f(v,p)){Ii.value=v.uuid;return}}})(),Sr(async()=>{if(o(),OT.value&&await pJ(),gg.value)try{await QE()}catch(p){console.error("Failed to auto-sync settings on app load:",p)}});const d=ae(()=>!Nb.value||Ec.value===0?"":`blur-intensity-${Ec.value}`);return UEe(),(p,v)=>(V(),j("div",{ref_key:"app",ref:t,id:"app-content",class:tt(["bg-base-100 flex w-screen overflow-hidden",i.value,R(Nb)&&`custom-background-${R(xb)} custom-background bg-cover bg-center`,d.value]),style:sn([R(Nb),{height:"var(--app-height, 100dvh)"}])},[B(R(WM)),B(dSe),I("div",{ref_key:"toast",ref:n,class:"toast-sm toast toast-end toast-top z-[100000] max-w-80 text-sm md:max-w-96 md:translate-y-8"},null,512)],6))}}),bJ=e=>{const t=e.trim();if(!t)return null;const n=t.split(/\s+/).filter(Boolean),r=[];for(const i of n)try{r.push(new RegExp(i,"i"))}catch{return null}return r.length?r:null},Ip=e=>{const t=bJ(e);return t?{test:n=>t.every(r=>r.test(n)),testAny:n=>t.every(r=>n.some(i=>r.test(i)))}:null},T6=(e,t)=>{const n=bJ(t);if(!n||!e)return[{text:e,matched:!1}];const r=[];if(n.forEach(s=>{const l=s.flags.includes("g")?s.flags:`${s.flags}g`,u=new RegExp(s.source,l);let c;for(;c=u.exec(e);){const f=c.index,h=f+c[0].length;h>f&&r.push([f,h]),c[0].length===0&&(u.lastIndex+=1)}}),!r.length)return[{text:e,matched:!1}];r.sort((s,l)=>s[0]-l[0]||s[1]-l[1]);const i=r.reduce((s,l)=>{const u=s.at(-1);return!u||l[0]>u[1]?s.push([...l]):u[1]=Math.max(u[1],l[1]),s},[]),o=[];let a=0;return i.forEach(([s,l])=>{s>a&&o.push({text:e.slice(a,s),matched:!1}),o.push({text:e.slice(s,l),matched:!0}),a=l}),a{e(!1)})),DO=()=>Sn.value?.uuid||"",SJ=[ar.SourceIP,ar.Destination,ar.Process,ar.Outbound],U1=me({[ar.SourceIP]:[],[ar.Destination]:[],[ar.Process]:[],[ar.Outbound]:[]}),OO=()=>{U1.value={[ar.SourceIP]:[],[ar.Destination]:[],[ar.Process]:[],[ar.Outbound]:[]},_J.value=new Promise(async e=>{for(const t of SJ){const n=await QEe(DO(),t);let r=n;n.length>2e3&&(r=n.sort((i,o)=>o.download-i.download).slice(0,1500),await yJ(DO(),t,r)),U1.value[t]=r}e(!0)})},wJ=(e,t)=>{const n=new Map;return e.forEach(r=>{let i="";if(t===ar.SourceIP)i=fd(r);else if(t===ar.Destination){const o=NEe(r);o8.IPv4.isValid(o)||o8.IPv6.isValid(o)?i=o:i=o.split(".").slice(-2).join(".")}else t===ar.Process?i=MEe(r):t===ar.Outbound&&(i=xu(r)[0]||"-");if(n.has(i)){const o=n.get(i);o.download+=wm(r),o.upload+=xm(r),o.count+=1}else n.set(i,{key:i,download:wm(r),upload:xm(r),count:1})}),Array.from(n.values())},xJ=(e,t)=>{const n=new Map;return e.forEach(r=>{n.set(r.key,{...r})}),t.forEach(r=>{if(n.has(r.key)){const i=n.get(r.key);i.download+=r.download,i.upload+=r.upload,i.count+=r.count}else n.set(r.key,{...r})}),Array.from(n.values())},eCe=async e=>{if(e.length!==0){await _J.value;for(const t of SJ)try{const n=wJ(e,t),r=U1.value[t],i=xJ(r,n);U1.value[t]=i,await yJ(DO(),t,i)}catch(n){console.error(`Failed to save connection history for ${t}:`,n)}}},pc=me(jp.ACTIVE),LO=Qe("config/connection-sort-type",Vo.HOST),LT=Qe("config/connection-sort-direction",Bh.ASC),NO=Qe("config/quick-filter-regex","direct|dns-out"),Ef=Qe("config/quick-filter-enabled",!1),Ic=me(""),Xl=me(null),Xo=me([]),NT=me([]),MT=me(!1),Tm=me(0),Em=me(0);let E6;const tCe=()=>{E6?.(),Xo.value=[],NT.value=[],Tm.value=0,Em.value=0,OO();const e=PEe(),t=et(e.data,n=>{n&&(n.downloadTotal!=null&&n.uploadTotal!=null&&(Tm.value=n.downloadTotal,Em.value=n.uploadTotal),!MT.value&&(Xo.value=n.active,n.closed.length>0&&(NT.value=NT.value.concat(n.closed).slice(-500),eCe(n.closed))))});tg.value&&mX(Xo,()=>{Xo.value.filter(n=>LEe(n)!=="tcp").forEach(n=>{const r=Br(),i=Br($1(n));r.diff(i,"minute")>iT.value&&vy(n.id)})}),E6=()=>{t(),e.close()}},nCe=ae(()=>LT.value===Bh.DESC),C6={[Vo.HOST]:(e,t)=>y6(e).localeCompare(y6(t)),[Vo.RULE]:(e,t)=>RO(e).localeCompare(RO(t)),[Vo.CHAINS]:(e,t)=>S6(e).localeCompare(S6(t)),[Vo.DOWNLOAD]:(e,t)=>wm(e)-wm(t),[Vo.DOWNLOAD_SPEED]:(e,t)=>e.downloadSpeed-t.downloadSpeed,[Vo.UPLOAD]:(e,t)=>xm(e)-xm(t),[Vo.UPLOAD_SPEED]:(e,t)=>e.uploadSpeed-t.uploadSpeed,[Vo.SOURCE_IP]:(e,t)=>fd(e).localeCompare(fd(t)),[Vo.TYPE]:(e,t)=>b6(e).localeCompare(b6(t)),[Vo.CONNECT_TIME]:(e,t)=>Br($1(e)).valueOf()-Br($1(t)).valueOf(),[Vo.INBOUND_USER]:(e,t)=>_6(e).localeCompare(_6(t))},cp=ae(()=>pc.value===jp.ACTIVE?Xo.value:NT.value),Cm=ae(()=>{const e=Ip(Ic.value),t=Ef.value?Ip(NO.value):null,n={mode:Ka.value?"card":"table",proxyChainDirection:cu.value,showFullProxyChain:Qf.value},r=Ka.value?wi.value.flat():Ya.value;return cp.value.filter(i=>{const o=DEe(i,r,n);return Xl.value!==null&&Xl.value.every(a=>a!==fd(i))||t&&t.testAny(o)?!1:e?e.testAny(o):!0}).sort((i,o)=>{Ka.value&&nCe.value&&([i,o]=[o,i]);const a=Ka.value?C6[LO.value](i,o):C6[Vo.HOST](i,o);return a===0?i.id.localeCompare(o.id):a})}),Gg=me(0),TJ=me(0),gy=(e={offsetTop:8,offsetBottom:8})=>{const{offsetTop:t,offsetBottom:n}=e,r=ae(()=>ur.value?Gg.value+t:0),i=ae(()=>ur.value?TJ.value+n:0);return{padding:ae(()=>ur.value?{paddingTop:`${r.value}px`,paddingBottom:`${i.value}px`}:{}),paddingTop:r,paddingBottom:i}};function rCe(e,t,n){const r=new Array(e);return new Proxy(r,{get(i,o,a){if(typeof o=="string"){const s=o.charCodeAt(0);if(s>=48&&s<=57){const l=+o;if(Number.isInteger(l)&&l>=0&&lr[c]!==u))&&(r=s,i=t(...s),n?.onChange&&!(o&&n.skipInitialOnChange)&&n.onChange(i),o=!1),i}return a.updateDeps=s=>{r=s},a}function I6(e,t){if(e===void 0)throw new Error("Unexpected undefined");return e}const iCe=(e,t)=>Math.abs(e-t)<1.01,oCe=(e,t,n)=>{let r;return function(...i){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,i),n)}};let p0;const nk=()=>{if(p0!==void 0)return p0;if(typeof navigator>"u")return p0=!1;if(/iP(hone|od|ad)/.test(navigator.userAgent))return p0=!0;const e=navigator.maxTouchPoints;return p0=navigator.platform==="MacIntel"&&e!==void 0&&e>0},A6=e=>{const{offsetWidth:t,offsetHeight:n}=e;return{width:t,height:n}},aCe=e=>e,sCe=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1)-t+1,i=new Array(r);for(let o=0;o{const n=e.scrollElement;if(!n)return;const r=e.targetWindow;if(!r)return;const i=a=>{const{width:s,height:l}=a;t({width:Math.round(s),height:Math.round(l)})};if(i(A6(n)),!r.ResizeObserver)return()=>{};const o=new r.ResizeObserver(a=>{const s=()=>{const l=a[0];if(l?.borderBoxSize){const u=l.borderBoxSize[0];if(u){i({width:u.inlineSize,height:u.blockSize});return}}i(A6(n))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return o.observe(n,{box:"border-box"}),()=>{o.unobserve(n)}},qE={passive:!0},uCe=typeof window>"u"?!0:"onscrollend"in window,cCe=(e,t,n)=>{const r=e.scrollElement;if(!r)return;const i=e.targetWindow;if(!i)return;const o=e.options.useScrollendEvent&&uCe;let a=0;const s=o?null:oCe(i,()=>t(a,!1),e.options.isScrollingResetDelay),l=f=>()=>{a=n(r),s?.(),t(a,f)},u=l(!0),c=l(!1);return r.addEventListener("scroll",u,qE),o&&r.addEventListener("scrollend",c,qE),()=>{r.removeEventListener("scroll",u),o&&r.removeEventListener("scrollend",c)}},fCe=(e,t)=>cCe(e,t,n=>{const{horizontal:r,isRtl:i}=e.options;return r?n.scrollLeft*(i&&-1||1):n.scrollTop}),dCe=(e,t,n)=>{if(n.options.useCachedMeasurements){const r=n.indexFromElement(e),i=n.options.getItemKey(r);return n.itemSizeCache.get(i)??n.options.estimateSize(r)}if(t?.borderBoxSize){const r=t.borderBoxSize[0];if(r)return Math.round(r[n.options.horizontal?"inlineSize":"blockSize"])}if(!t){const r=n.indexFromElement(e),i=n.options.getItemKey(r),o=n.itemSizeCache.get(i);if(o!==void 0)return o}return e[n.options.horizontal?"offsetWidth":"offsetHeight"]},hCe=(e,{adjustments:t=0,behavior:n},r)=>{var i,o;(o=(i=r.scrollElement)==null?void 0:i.scrollTo)==null||o.call(i,{[r.options.horizontal?"left":"top"]:e+t,behavior:n})},pCe=hCe;class vCe{constructor(t){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollState=null,this.measurementsCache=[],this._flatMeasurements=null,this.itemSizeCache=new Map,this.itemSizeCacheVersion=0,this.laneAssignments=new Map,this.pendingMin=null,this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.pendingScrollAnchor=null,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this._iosDeferredAdjustment=0,this._iosTouching=!1,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._intendedScrollOffset=null,this.elementsCache=new Map,this.now=()=>{var n,r,i;return((i=(r=(n=this.targetWindow)==null?void 0:n.performance)==null?void 0:r.now)==null?void 0:i.call(r))??Date.now()},this.observer=(()=>{let n=null;const r=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(i=>{i.forEach(o=>{const a=()=>{const s=o.target,l=this.indexFromElement(s);if(!s.isConnected){this.observer.unobserve(s);for(const[u,c]of this.elementsCache)if(c===s){this.elementsCache.delete(u);break}return}this.shouldMeasureDuringScroll(l)&&this.resizeItem(l,this.options.measureElement(s,o,this))};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(a):a()})}));return{disconnect:()=>{var i;(i=r())==null||i.disconnect(),n=null},observe:i=>{var o;return(o=r())==null?void 0:o.observe(i,{box:"border-box"})},unobserve:i=>{var o;return(o=r())==null?void 0:o.unobserve(i)}}})(),this.range=null,this.setOptions=n=>{var r,i;const o={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:aCe,rangeExtractor:sCe,onChange:()=>{},measureElement:dCe,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,anchorTo:"start",followOnAppend:!1,scrollEndThreshold:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,laneAssignmentMode:"estimate",useCachedMeasurements:!1};for(const h in n){const d=n[h];d!==void 0&&(o[h]=d)}const a=this.options;let s=null,l=null,u=!1;if(a!==void 0&&a.enabled&&o.enabled&&o.anchorTo==="end"&&this.scrollElement!==null){const h=a.count,d=o.count,p=this.getMeasurements(),v=h>0?((r=p[0])==null?void 0:r.key)??a.getItemKey(0):null,y=h>0?((i=p[h-1])==null?void 0:i.key)??a.getItemKey(h-1):null;if(d!==h||h>0&&d>0&&(o.getItemKey(0)!==v||o.getItemKey(d-1)!==y)){u=!0;const S=h>0?this.getVirtualItemForOffset(this.getScrollOffset())??p[0]:null;S&&(s=[S.key,this.getScrollOffset()-S.start]);const w=o.followOnAppend===!0?"auto":o.followOnAppend||null;w&&d>h&&this.isAtEnd(a.scrollEndThreshold)&&(h===0||o.getItemKey(d-1)!==y)&&(l=w)}}this.options=o,u&&(this.pendingMin=0,this.itemSizeCacheVersion++);let c=!1,f=0;if(s&&this.scrollOffset!==null){const[h,d]=s,p=this.getMeasurements(),{count:v,getItemKey:y}=this.options;let m=0;for(;m{var r,i;(i=(r=this.options).onChange)==null||i.call(r,this,n)},this.maybeNotify=Av(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.rafId!=null&&this.targetWindow&&(this.targetWindow.cancelAnimationFrame(this.rafId),this.rafId=null),this.scrollState=null,this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.maybeNotify();return}if(this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(o=>{this.observer.observe(o)}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(o,a)=>{this._intendedScrollOffset!==null&&Math.abs(o-this._intendedScrollOffset)<1.5&&(o=this._intendedScrollOffset),this._intendedScrollOffset=null,this.scrollAdjustments=0,this.scrollDirection=a?this.getScrollOffset(){this._iosTouching=!0,this._iosJustTouchEnded=!1,this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)},s=()=>{this._iosTouching=!1,!(!nk()||this.targetWindow==null)&&(this._iosJustTouchEnded=!0,this._iosTouchEndTimerId=this.targetWindow.setTimeout(()=>{this._iosJustTouchEnded=!1,this._iosTouchEndTimerId=null,this._flushIosDeferredIfReady()},150))};o.addEventListener("touchstart",a,qE),o.addEventListener("touchend",s,qE),this.unsubs.push(()=>{o.removeEventListener("touchstart",a),o.removeEventListener("touchend",s),this._iosTouchEndTimerId!==null&&this.targetWindow!=null&&(this.targetWindow.clearTimeout(this._iosTouchEndTimerId),this._iosTouchEndTimerId=null)})}this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}const i=this.pendingScrollAnchor;if(this.pendingScrollAnchor=null,i&&this.scrollElement&&this.options.enabled){const[o,a,s,l]=i;o!==null&&!s&&(nk()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?l!==0&&(this._iosDeferredAdjustment+=l):this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})),s&&this.scrollToEnd({behavior:s})}},this._flushIosDeferredIfReady=()=>{if(this._iosDeferredAdjustment===0||this.isScrolling||this._iosTouching||this._iosJustTouchEnded)return;const n=this.getScrollOffset(),r=this.getMaxScrollOffset();if(n<0||n>r)return;const i=this._iosDeferredAdjustment;this._iosDeferredAdjustment=0,this._scrollToOffset(n,{adjustments:this.scrollAdjustments+=i,behavior:void 0})},this.rafId=null,this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,r)=>{const i=new Map,o=new Map;for(let a=r-1;a>=0;a--){const s=n[a];if(i.has(s.lane))continue;const l=o.get(s.lane);if(l==null||s.end>l.end?o.set(s.lane,s):s.enda.end===s.end?a.index-s.index:a.end-s.end)[0]:void 0},this.getMeasurementOptions=Av(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes,this.options.laneAssignmentMode],(n,r,i,o,a,s,l)=>(this.prevLanes!==void 0&&this.prevLanes!==s&&(this.lanesChangedFlag=!0),this.prevLanes=s,this.pendingMin=null,{count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:a,lanes:s,laneAssignmentMode:l}),{key:!1}),this.getMeasurements=Av(()=>[this.getMeasurementOptions(),this.itemSizeCacheVersion],({count:n,paddingStart:r,scrollMargin:i,getItemKey:o,enabled:a,lanes:s,laneAssignmentMode:l},u)=>{const c=this.itemSizeCache;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>n)for(const p of this.laneAssignments.keys())p>=n&&this.laneAssignments.delete(p);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMin=null),this.measurementsCache.length===0&&!this.lanesSettling&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(p=>{this.itemSizeCache.set(p.key,p.size)}));const f=this.lanesSettling?0:this.pendingMin??0;if(this.pendingMin=null,this.lanesSettling&&this.measurementsCache.length===n&&(this.lanesSettling=!1),s===1){const p=this.options.gap,v=n*2;let y=this._flatMeasurements;if(!y||y.length0&&S.set(y.subarray(0,f*2)),y=S,this._flatMeasurements=y}let m;if(f===0)m=r+i;else{const S=f-1;m=y[S*2]+y[S*2+1]+p}for(let S=f;S1){m=y;const C=d[m],P=C!==void 0?h[C]:void 0;b=P?P.end+this.options.gap:r+i}else{const C=this.options.lanes===1?h[p-1]:this.getFurthestMeasurement(h,p);b=C?C.end+this.options.gap:r+i,m=C?C.lane:p%this.options.lanes,this.options.lanes>1&&S&&this.laneAssignments.set(p,m)}const w=c.get(v),x=typeof w=="number"?w:this.options.estimateSize(p),T=b+x;h[p]={index:p,start:b,size:x,end:T,key:v,lane:m},d[m]=p}return this.measurementsCache=h,h},{key:!1,debug:()=>this.options.debug}),this.calculateRange=Av(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(n,r,i,o)=>this.range=n.length>0&&r>0?gCe({measurements:n,outerSize:r,scrollOffset:i,lanes:o,flat:o===1&&this._flatMeasurements!=null?this._flatMeasurements:null}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=Av(()=>{let n=null,r=null;const i=this.calculateRange();return i&&(n=i.startIndex,r=i.endIndex),this.maybeNotify.updateDeps([this.isScrolling,n,r]),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,r]},(n,r,i,o,a)=>o===null||a===null?[]:n({startIndex:o,endIndex:a,overscan:r,count:i}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const r=this.options.indexAttribute,i=n.getAttribute(r);return i?parseInt(i,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this.shouldMeasureDuringScroll=n=>{var r;if(!this.scrollState||this.scrollState.behavior!=="smooth")return!0;const i=this.scrollState.index??((r=this.getVirtualItemForOffset(this.scrollState.lastTargetOffset))==null?void 0:r.index);if(i!==void 0&&this.range){const o=Math.max(this.options.overscan,Math.ceil((this.range.endIndex-this.range.startIndex)/2)),a=Math.max(0,i-o),s=Math.min(this.options.count-1,i+o);return n>=a&&n<=s}return!0},this.measureElement=n=>{if(!n){this.elementsCache.forEach((a,s)=>{a.isConnected||(this.observer.unobserve(a),this.elementsCache.delete(s))});return}const r=this.indexFromElement(n),i=this.options.getItemKey(r),o=this.elementsCache.get(i);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(i,n)),(!this.isScrolling||this.scrollState)&&this.shouldMeasureDuringScroll(r)&&this.resizeItem(r,this.options.measureElement(n,void 0,this))},this.resizeItem=(n,r)=>{var i,o;if(n<0||n>=this.options.count)return;let a,s,l;const u=this._flatMeasurements;if(this.options.lanes===1&&u!==null)l=this.options.getItemKey(n),s=u[n*2],a=u[n*2+1];else{const h=this.measurementsCache[n];if(!h)return;l=h.key,s=h.start,a=h.size}const c=this.itemSizeCache.get(l)??a,f=r-c;if(f!==0){const h=this.options.anchorTo==="end"&&((i=this.scrollState)==null?void 0:i.behavior)!=="smooth"&&this.getVirtualDistanceFromEnd()<=this.options.scrollEndThreshold,d=h?this.getTotalSize():0,p=((o=this.scrollState)==null?void 0:o.behavior)!=="smooth"&&(this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(this.measurementsCache[n]??{index:n,key:l,start:s,size:a,end:s+a,lane:0},f,this):s[this.getVirtualIndexes(),this.getMeasurements()],(n,r)=>{const i=[];for(let o=0,a=n.length;othis.options.debug}),this.getVirtualItemForOffset=n=>{const r=this.getMeasurements();if(r.length===0)return;const i=this._flatMeasurements,o=this.options.lanes===1&&i!=null,a=EJ(0,r.length-1,o?s=>i[s*2]:s=>I6(r[s]).start,n);return I6(r[a])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const n=this.scrollElement.document.documentElement;return this.options.horizontal?n.scrollWidth-this.scrollElement.innerWidth:n.scrollHeight-this.scrollElement.innerHeight}},this.getVirtualDistanceFromEnd=()=>Math.max(this.getTotalSize()-this.getSize()-this.getScrollOffset(),0),this.getDistanceFromEnd=()=>Math.max(this.getMaxScrollOffset()-this.getScrollOffset(),0),this.isAtEnd=(n=this.options.scrollEndThreshold)=>this.getDistanceFromEnd()<=n,this.getOffsetForAlignment=(n,r,i=0)=>{if(!this.scrollElement)return 0;const o=this.getSize(),a=this.getScrollOffset();r==="auto"&&(r=n>=a+o?"end":"start"),r==="center"?n+=(i-o)/2:r==="end"&&(n-=o);const s=this.getMaxScrollOffset();return Math.max(Math.min(s,n),0)},this.getOffsetForIndex=(n,r="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const i=this.getSize(),o=this.getScrollOffset(),a=this.measurementsCache[n];if(!a)return;if(r==="auto")if(a.end>=o+i-this.options.scrollPaddingEnd)r="end";else if(a.start<=o+this.options.scrollPaddingStart)r="start";else return[o,r];if(r==="end"&&n===this.options.count-1)return[this.getMaxScrollOffset(),r];const s=r==="end"?a.end+this.options.scrollPaddingEnd:a.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r,a.size),r]},this.scrollToOffset=(n,{align:r="start",behavior:i="auto"}={})=>{const o=this.getOffsetForAlignment(n,r),a=this.now();this.scrollState={index:null,align:r,behavior:i,startedAt:a,lastTargetOffset:o,stableFrames:0},this._scrollToOffset(o,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollToIndex=(n,{align:r="auto",behavior:i="auto"}={})=>{n=Math.max(0,Math.min(n,this.options.count-1));const o=this.getOffsetForIndex(n,r);if(!o)return;const[a,s]=o,l=this.now();this.scrollState={index:n,align:s,behavior:i,startedAt:l,lastTargetOffset:a,stableFrames:0},this._scrollToOffset(a,{adjustments:void 0,behavior:i}),this.scheduleScrollReconcile()},this.scrollBy=(n,{behavior:r="auto"}={})=>{const i=this.getScrollOffset()+n,o=this.now();this.scrollState={index:null,align:"start",behavior:r,startedAt:o,lastTargetOffset:i,stableFrames:0},this._scrollToOffset(i,{adjustments:void 0,behavior:r}),this.scheduleScrollReconcile()},this.scrollToEnd=({behavior:n="auto"}={})=>{if(this.options.count>0){this.scrollToIndex(this.options.count-1,{align:"end",behavior:n});return}this.scrollToOffset(Math.max(this.getTotalSize()-this.getSize(),0),{behavior:n})},this.getTotalSize=()=>{var n;const r=this.getMeasurements();let i;if(r.length===0)i=this.options.paddingStart;else if(this.options.lanes===1){const o=r.length-1,a=this._flatMeasurements;a!=null?i=a[o*2]+a[o*2+1]:i=((n=r[o])==null?void 0:n.end)??0}else{const o=Array(this.options.lanes).fill(null);let a=r.length-1;for(;a>=0&&o.some(s=>s===null);){const s=r[a];o[s.lane]===null&&(o[s.lane]=s.end),a--}i=Math.max(...o.filter(s=>s!==null))}return Math.max(i-this.options.scrollMargin+this.options.paddingEnd,0)},this.takeSnapshot=()=>{const n=[];if(this.itemSizeCache.size===0)return n;const r=this.getMeasurements();for(const i of r)i&&this.itemSizeCache.has(i.key)&&n.push({index:i.index,key:i.key,start:i.start,size:i.size,end:i.end,lane:i.lane});return n},this._scrollToOffset=(n,{adjustments:r,behavior:i})=>{this._intendedScrollOffset=n+(r??0),this.options.scrollToFn(n,{behavior:i,adjustments:r},this)},this.measure=()=>{this.pendingMin=null,this.itemSizeCache.clear(),this.laneAssignments.clear(),this.itemSizeCacheVersion++,this.notify(!1)},this.setOptions(t)}applyScrollAdjustment(t,n){t!==0&&(nk()&&(this.isScrolling||this._iosTouching||this._iosJustTouchEnded)?this._iosDeferredAdjustment+=t:this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=t,behavior:n}))}scheduleScrollReconcile(){if(!this.targetWindow){this.scrollState=null;return}this.rafId==null&&(this.rafId=this.targetWindow.requestAnimationFrame(()=>{this.rafId=null,this.reconcileScroll()}))}reconcileScroll(){if(!this.scrollState||!this.scrollElement)return;if(this.now()-this.scrollState.startedAt>5e3){this.scrollState=null;return}const r=this.scrollState.index!=null?this.getOffsetForIndex(this.scrollState.index,this.scrollState.align):void 0,i=r?r[0]:this.scrollState.lastTargetOffset,o=1,a=i!==this.scrollState.lastTargetOffset;if(!a&&iCe(i,this.getScrollOffset())){if(this.scrollState.stableFrames++,this.scrollState.stableFrames>=o){this.getScrollOffset()!==i&&this._scrollToOffset(i,{adjustments:void 0,behavior:"auto"}),this.scrollState=null;return}}else if(this.scrollState.stableFrames=0,a){const s=this.getSize()||600,l=Math.abs(i-this.getScrollOffset()),u=this.scrollState.behavior==="smooth"&&l>s;this.scrollState.lastTargetOffset=i,u||(this.scrollState.behavior="auto"),this._scrollToOffset(i,{adjustments:void 0,behavior:u?"smooth":"auto"})}this.scheduleScrollReconcile()}}const EJ=(e,t,n,r)=>{for(;e<=t;){const i=(e+t)/2|0,o=n(i);if(or)t=i-1;else return i}return e>0?e-1:0};function gCe({measurements:e,outerSize:t,scrollOffset:n,lanes:r,flat:i}){const o=e.length-1,a=i?c=>i[c*2]:c=>e[c].start,s=i?c=>i[c*2]+i[c*2+1]:c=>e[c].end;if(e.length<=r)return{startIndex:0,endIndex:o};let l=EJ(0,o,a,n),u=l;if(r===1)for(;u1){const c=Array(r).fill(0);for(;uh=0&&f.some(h=>h>=n);){const h=e[l];f[h.lane]=h.start,l--}l=Math.max(0,l-l%r),u=Math.min(o,u+(r-1-u%r))}return{startIndex:l,endIndex:u}}function mCe(e){const t=new vCe(R(e)),n=mn(t),r=t._didMount();return et(()=>R(e).getScrollElement(),i=>{i&&t._willUpdate()},{immediate:!0}),et(()=>R(e),i=>{t.setOptions({...i,onChange:(o,a)=>{var s;CD(n),(s=i.onChange)==null||s.call(i,o,a)}}),t._willUpdate(),CD(n)},{immediate:!0}),R_(r),n}function O5(e){return mCe(ae(()=>({observeElementRect:lCe,observeElementOffset:fCe,scrollToFn:pCe,...R(e)})))}const yCe=["data-index"],L5=Ye({__name:"VirtualScroller",props:{data:{default:()=>[]},size:{default:64},overscan:{default:24},contentClass:{default:""}},setup(e){const{paddingTop:t,paddingBottom:n}=gy({offsetTop:0,offsetBottom:0}),r=me(null),i=e,o=ae(()=>({count:i.data.length,getScrollElement:()=>r.value,estimateSize:()=>i.size,overscan:i.overscan,paddingStart:t.value,paddingEnd:n.value+24})),a=O5(o),s=ae(()=>a.value.getVirtualItems()),l=ae(()=>a.value.getTotalSize()),u=f=>f!==0?"border-base-border border-t":"",c=f=>{f&&Tr(()=>{a.value.measureElement(f)})};return(f,h)=>(V(),j("div",{ref_key:"parentRef",ref:r,class:"flex h-full w-full flex-col overflow-y-auto"},[Ea(f.$slots,"before"),e.data.length>0?(V(),j("div",{key:0,style:sn({height:`${l.value}px`}),class:"relative w-full shrink-0"},[I("div",{class:tt(["base-container virtual-scroller absolute top-3 right-3 left-3",e.contentClass]),style:sn({transform:`translateY(${s.value[0]?.start??0}px)`})},[(V(!0),j($e,null,Ct(s.value,d=>(V(),j("div",{key:d.key.toString(),"data-index":d.index,ref_for:!0,ref:p=>c(p),class:tt(u(d.index))},[Ea(f.$slots,"default",{item:e.data[d.index],index:d.index})],10,yCe))),128))],6)],4)):(V(),j("div",{key:1,class:"base-container m-3 flex-row p-3 text-sm",style:sn({marginTop:`${R(t)+12}px`,marginBottom:`${R(n)}px`})},K(f.$t("noData")),5))],512))}});function nS(e=720){const t=yM(),{width:n}=ku(t);return{isLargeCtrlsBar:ae(()=>n.value>lr(e))}}var Ra="top",Us="bottom",Gs="right",ka="left",N5="auto",rS=[Ra,Us,Gs,ka],Im="start",G1="end",bCe="clippingParents",CJ="viewport",v0="popper",_Ce="reference",R6=rS.reduce(function(e,t){return e.concat([t+"-"+Im,t+"-"+G1])},[]),IJ=[].concat(rS,[N5]).reduce(function(e,t){return e.concat([t,t+"-"+Im,t+"-"+G1])},[]),SCe="beforeRead",wCe="read",xCe="afterRead",TCe="beforeMain",ECe="main",CCe="afterMain",ICe="beforeWrite",ACe="write",RCe="afterWrite",kCe=[SCe,wCe,xCe,TCe,ECe,CCe,ICe,ACe,RCe];function Tu(e){return e?(e.nodeName||"").toLowerCase():null}function rs(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ap(e){var t=rs(e).Element;return e instanceof t||e instanceof Element}function Ls(e){var t=rs(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function M5(e){if(typeof ShadowRoot>"u")return!1;var t=rs(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function PCe(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var r=t.styles[n]||{},i=t.attributes[n]||{},o=t.elements[n];!Ls(o)||!Tu(o)||(Object.assign(o.style,r),Object.keys(i).forEach(function(a){var s=i[a];s===!1?o.removeAttribute(a):o.setAttribute(a,s===!0?"":s)}))})}function DCe(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(r){var i=t.elements[r],o=t.attributes[r]||{},a=Object.keys(t.styles.hasOwnProperty(r)?t.styles[r]:n[r]),s=a.reduce(function(l,u){return l[u]="",l},{});!Ls(i)||!Tu(i)||(Object.assign(i.style,s),Object.keys(o).forEach(function(l){i.removeAttribute(l)}))})}}const AJ={name:"applyStyles",enabled:!0,phase:"write",fn:PCe,effect:DCe,requires:["computeStyles"]};function hu(e){return e.split("-")[0]}var fp=Math.max,eC=Math.min,Am=Math.round;function MO(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function RJ(){return!/^((?!chrome|android).)*safari/i.test(MO())}function Rm(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var r=e.getBoundingClientRect(),i=1,o=1;t&&Ls(e)&&(i=e.offsetWidth>0&&Am(r.width)/e.offsetWidth||1,o=e.offsetHeight>0&&Am(r.height)/e.offsetHeight||1);var a=Ap(e)?rs(e):window,s=a.visualViewport,l=!RJ()&&n,u=(r.left+(l&&s?s.offsetLeft:0))/i,c=(r.top+(l&&s?s.offsetTop:0))/o,f=r.width/i,h=r.height/o;return{width:f,height:h,top:c,right:u+f,bottom:c+h,left:u,x:u,y:c}}function F5(e){var t=Rm(e),n=e.offsetWidth,r=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-r)<=1&&(r=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:r}}function kJ(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&M5(n)){var r=t;do{if(r&&e.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Vc(e){return rs(e).getComputedStyle(e)}function OCe(e){return["table","td","th"].indexOf(Tu(e))>=0}function Cd(e){return((Ap(e)?e.ownerDocument:e.document)||window.document).documentElement}function GI(e){return Tu(e)==="html"?e:e.assignedSlot||e.parentNode||(M5(e)?e.host:null)||Cd(e)}function k6(e){return!Ls(e)||Vc(e).position==="fixed"?null:e.offsetParent}function LCe(e){var t=/firefox/i.test(MO()),n=/Trident/i.test(MO());if(n&&Ls(e)){var r=Vc(e);if(r.position==="fixed")return null}var i=GI(e);for(M5(i)&&(i=i.host);Ls(i)&&["html","body"].indexOf(Tu(i))<0;){var o=Vc(i);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return i;i=i.parentNode}return null}function iS(e){for(var t=rs(e),n=k6(e);n&&OCe(n)&&Vc(n).position==="static";)n=k6(n);return n&&(Tu(n)==="html"||Tu(n)==="body"&&Vc(n).position==="static")?t:n||LCe(e)||t}function $5(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Mb(e,t,n){return fp(e,eC(t,n))}function NCe(e,t,n){var r=Mb(e,t,n);return r>n?n:r}function PJ(){return{top:0,right:0,bottom:0,left:0}}function DJ(e){return Object.assign({},PJ(),e)}function OJ(e,t){return t.reduce(function(n,r){return n[r]=e,n},{})}var MCe=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,DJ(typeof t!="number"?t:OJ(t,rS))};function FCe(e){var t,n=e.state,r=e.name,i=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=hu(n.placement),l=$5(s),u=[ka,Gs].indexOf(s)>=0,c=u?"height":"width";if(!(!o||!a)){var f=MCe(i.padding,n),h=F5(o),d=l==="y"?Ra:ka,p=l==="y"?Us:Gs,v=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],y=a[l]-n.rects.reference[l],m=iS(o),b=m?l==="y"?m.clientHeight||0:m.clientWidth||0:0,S=v/2-y/2,w=f[d],x=b-h[c]-f[p],T=b/2-h[c]/2+S,C=Mb(w,T,x),P=l;n.modifiersData[r]=(t={},t[P]=C,t.centerOffset=C-T,t)}}function $Ce(e){var t=e.state,n=e.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=t.elements.popper.querySelector(i),!i)||kJ(t.elements.popper,i)&&(t.elements.arrow=i))}const BCe={name:"arrow",enabled:!0,phase:"main",fn:FCe,effect:$Ce,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function km(e){return e.split("-")[1]}var VCe={top:"auto",right:"auto",bottom:"auto",left:"auto"};function UCe(e,t){var n=e.x,r=e.y,i=t.devicePixelRatio||1;return{x:Am(n*i)/i||0,y:Am(r*i)/i||0}}function P6(e){var t,n=e.popper,r=e.popperRect,i=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,f=e.isFixed,h=a.x,d=h===void 0?0:h,p=a.y,v=p===void 0?0:p,y=typeof c=="function"?c({x:d,y:v}):{x:d,y:v};d=y.x,v=y.y;var m=a.hasOwnProperty("x"),b=a.hasOwnProperty("y"),S=ka,w=Ra,x=window;if(u){var T=iS(n),C="clientHeight",P="clientWidth";if(T===rs(n)&&(T=Cd(n),Vc(T).position!=="static"&&s==="absolute"&&(C="scrollHeight",P="scrollWidth")),T=T,i===Ra||(i===ka||i===Gs)&&o===G1){w=Us;var k=f&&T===x&&x.visualViewport?x.visualViewport.height:T[C];v-=k-r.height,v*=l?1:-1}if(i===ka||(i===Ra||i===Us)&&o===G1){S=Gs;var L=f&&T===x&&x.visualViewport?x.visualViewport.width:T[P];d-=L-r.width,d*=l?1:-1}}var O=Object.assign({position:s},u&&VCe),M=c===!0?UCe({x:d,y:v},rs(n)):{x:d,y:v};if(d=M.x,v=M.y,l){var F;return Object.assign({},O,(F={},F[w]=b?"0":"",F[S]=m?"0":"",F.transform=(x.devicePixelRatio||1)<=1?"translate("+d+"px, "+v+"px)":"translate3d("+d+"px, "+v+"px, 0)",F))}return Object.assign({},O,(t={},t[w]=b?v+"px":"",t[S]=m?d+"px":"",t.transform="",t))}function GCe(e){var t=e.state,n=e.options,r=n.gpuAcceleration,i=r===void 0?!0:r,o=n.adaptive,a=o===void 0?!0:o,s=n.roundOffsets,l=s===void 0?!0:s,u={placement:hu(t.placement),variation:km(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:i,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,P6(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,P6(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const HCe={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:GCe,data:{}};var Nw={passive:!0};function WCe(e){var t=e.state,n=e.instance,r=e.options,i=r.scroll,o=i===void 0?!0:i,a=r.resize,s=a===void 0?!0:a,l=rs(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&u.forEach(function(c){c.addEventListener("scroll",n.update,Nw)}),s&&l.addEventListener("resize",n.update,Nw),function(){o&&u.forEach(function(c){c.removeEventListener("scroll",n.update,Nw)}),s&&l.removeEventListener("resize",n.update,Nw)}}const zCe={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:WCe,data:{}};var YCe={left:"right",right:"left",bottom:"top",top:"bottom"};function FT(e){return e.replace(/left|right|bottom|top/g,function(t){return YCe[t]})}var jCe={start:"end",end:"start"};function D6(e){return e.replace(/start|end/g,function(t){return jCe[t]})}function B5(e){var t=rs(e),n=t.pageXOffset,r=t.pageYOffset;return{scrollLeft:n,scrollTop:r}}function V5(e){return Rm(Cd(e)).left+B5(e).scrollLeft}function XCe(e,t){var n=rs(e),r=Cd(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;var u=RJ();(u||!u&&t==="fixed")&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s+V5(e),y:l}}function KCe(e){var t,n=Cd(e),r=B5(e),i=(t=e.ownerDocument)==null?void 0:t.body,o=fp(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=fp(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+V5(e),l=-r.scrollTop;return Vc(i||n).direction==="rtl"&&(s+=fp(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}function U5(e){var t=Vc(e),n=t.overflow,r=t.overflowX,i=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function LJ(e){return["html","body","#document"].indexOf(Tu(e))>=0?e.ownerDocument.body:Ls(e)&&U5(e)?e:LJ(GI(e))}function Fb(e,t){var n;t===void 0&&(t=[]);var r=LJ(e),i=r===((n=e.ownerDocument)==null?void 0:n.body),o=rs(r),a=i?[o].concat(o.visualViewport||[],U5(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(Fb(GI(a)))}function FO(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ZCe(e,t){var n=Rm(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function O6(e,t,n){return t===CJ?FO(XCe(e,n)):Ap(t)?ZCe(t,n):FO(KCe(Cd(e)))}function JCe(e){var t=Fb(GI(e)),n=["absolute","fixed"].indexOf(Vc(e).position)>=0,r=n&&Ls(e)?iS(e):e;return Ap(r)?t.filter(function(i){return Ap(i)&&kJ(i,r)&&Tu(i)!=="body"}):[]}function QCe(e,t,n,r){var i=t==="clippingParents"?JCe(e):[].concat(t),o=[].concat(i,[n]),a=o[0],s=o.reduce(function(l,u){var c=O6(e,u,r);return l.top=fp(c.top,l.top),l.right=eC(c.right,l.right),l.bottom=eC(c.bottom,l.bottom),l.left=fp(c.left,l.left),l},O6(e,a,r));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function NJ(e){var t=e.reference,n=e.element,r=e.placement,i=r?hu(r):null,o=r?km(r):null,a=t.x+t.width/2-n.width/2,s=t.y+t.height/2-n.height/2,l;switch(i){case Ra:l={x:a,y:t.y-n.height};break;case Us:l={x:a,y:t.y+t.height};break;case Gs:l={x:t.x+t.width,y:s};break;case ka:l={x:t.x-n.width,y:s};break;default:l={x:t.x,y:t.y}}var u=i?$5(i):null;if(u!=null){var c=u==="y"?"height":"width";switch(o){case Im:l[u]=l[u]-(t[c]/2-n[c]/2);break;case G1:l[u]=l[u]+(t[c]/2-n[c]/2);break}}return l}function H1(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=r===void 0?e.placement:r,o=n.strategy,a=o===void 0?e.strategy:o,s=n.boundary,l=s===void 0?bCe:s,u=n.rootBoundary,c=u===void 0?CJ:u,f=n.elementContext,h=f===void 0?v0:f,d=n.altBoundary,p=d===void 0?!1:d,v=n.padding,y=v===void 0?0:v,m=DJ(typeof y!="number"?y:OJ(y,rS)),b=h===v0?_Ce:v0,S=e.rects.popper,w=e.elements[p?b:h],x=QCe(Ap(w)?w:w.contextElement||Cd(e.elements.popper),l,c,a),T=Rm(e.elements.reference),C=NJ({reference:T,element:S,placement:i}),P=FO(Object.assign({},S,C)),k=h===v0?P:T,L={top:x.top-k.top+m.top,bottom:k.bottom-x.bottom+m.bottom,left:x.left-k.left+m.left,right:k.right-x.right+m.right},O=e.modifiersData.offset;if(h===v0&&O){var M=O[i];Object.keys(L).forEach(function(F){var U=[Gs,Us].indexOf(F)>=0?1:-1,X=[Ra,Us].indexOf(F)>=0?"y":"x";L[F]+=M[X]*U})}return L}function qCe(e,t){t===void 0&&(t={});var n=t,r=n.placement,i=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,u=l===void 0?IJ:l,c=km(r),f=c?s?R6:R6.filter(function(p){return km(p)===c}):rS,h=f.filter(function(p){return u.indexOf(p)>=0});h.length===0&&(h=f);var d=h.reduce(function(p,v){return p[v]=H1(e,{placement:v,boundary:i,rootBoundary:o,padding:a})[hu(v)],p},{});return Object.keys(d).sort(function(p,v){return d[p]-d[v]})}function eIe(e){if(hu(e)===N5)return[];var t=FT(e);return[D6(e),t,D6(t)]}function tIe(e){var t=e.state,n=e.options,r=e.name;if(!t.modifiersData[r]._skip){for(var i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!0:a,l=n.fallbackPlacements,u=n.padding,c=n.boundary,f=n.rootBoundary,h=n.altBoundary,d=n.flipVariations,p=d===void 0?!0:d,v=n.allowedAutoPlacements,y=t.options.placement,m=hu(y),b=m===y,S=l||(b||!p?[FT(y)]:eIe(y)),w=[y].concat(S).reduce(function(Re,Me){return Re.concat(hu(Me)===N5?qCe(t,{placement:Me,boundary:c,rootBoundary:f,padding:u,flipVariations:p,allowedAutoPlacements:v}):Me)},[]),x=t.rects.reference,T=t.rects.popper,C=new Map,P=!0,k=w[0],L=0;L=0,X=U?"width":"height",$=H1(t,{placement:O,boundary:c,rootBoundary:f,altBoundary:h,padding:u}),W=U?F?Gs:ka:F?Us:Ra;x[X]>T[X]&&(W=FT(W));var G=FT(W),Q=[];if(o&&Q.push($[M]<=0),s&&Q.push($[W]<=0,$[G]<=0),Q.every(function(Re){return Re})){k=O,P=!1;break}C.set(O,Q)}if(P)for(var ne=p?3:1,re=function(Me){var be=w.find(function(fe){var Le=C.get(fe);if(Le)return Le.slice(0,Me).every(function(Ce){return Ce})});if(be)return k=be,"break"},pe=ne;pe>0;pe--){var ke=re(pe);if(ke==="break")break}t.placement!==k&&(t.modifiersData[r]._skip=!0,t.placement=k,t.reset=!0)}}const nIe={name:"flip",enabled:!0,phase:"main",fn:tIe,requiresIfExists:["offset"],data:{_skip:!1}};function L6(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function N6(e){return[Ra,Gs,Us,ka].some(function(t){return e[t]>=0})}function rIe(e){var t=e.state,n=e.name,r=t.rects.reference,i=t.rects.popper,o=t.modifiersData.preventOverflow,a=H1(t,{elementContext:"reference"}),s=H1(t,{altBoundary:!0}),l=L6(a,r),u=L6(s,i,o),c=N6(l),f=N6(u);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}const iIe={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:rIe};function oIe(e,t,n){var r=hu(e),i=[ka,Ra].indexOf(r)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*i,[ka,Gs].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function aIe(e){var t=e.state,n=e.options,r=e.name,i=n.offset,o=i===void 0?[0,0]:i,a=IJ.reduce(function(c,f){return c[f]=oIe(f,t.rects,o),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[r]=a}const sIe={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:aIe};function lIe(e){var t=e.state,n=e.name;t.modifiersData[n]=NJ({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const uIe={name:"popperOffsets",enabled:!0,phase:"read",fn:lIe,data:{}};function cIe(e){return e==="x"?"y":"x"}function fIe(e){var t=e.state,n=e.options,r=e.name,i=n.mainAxis,o=i===void 0?!0:i,a=n.altAxis,s=a===void 0?!1:a,l=n.boundary,u=n.rootBoundary,c=n.altBoundary,f=n.padding,h=n.tether,d=h===void 0?!0:h,p=n.tetherOffset,v=p===void 0?0:p,y=H1(t,{boundary:l,rootBoundary:u,padding:f,altBoundary:c}),m=hu(t.placement),b=km(t.placement),S=!b,w=$5(m),x=cIe(w),T=t.modifiersData.popperOffsets,C=t.rects.reference,P=t.rects.popper,k=typeof v=="function"?v(Object.assign({},t.rects,{placement:t.placement})):v,L=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),O=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,M={x:0,y:0};if(T){if(o){var F,U=w==="y"?Ra:ka,X=w==="y"?Us:Gs,$=w==="y"?"height":"width",W=T[w],G=W+y[U],Q=W-y[X],ne=d?-P[$]/2:0,re=b===Im?C[$]:P[$],pe=b===Im?-P[$]:-C[$],ke=t.elements.arrow,Re=d&&ke?F5(ke):{width:0,height:0},Me=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:PJ(),be=Me[U],fe=Me[X],Le=Mb(0,C[$],Re[$]),Ce=S?C[$]/2-ne-Le-be-L.mainAxis:re-Le-be-L.mainAxis,Ue=S?-C[$]/2+ne+Le+fe+L.mainAxis:pe+Le+fe+L.mainAxis,Be=t.elements.arrow&&iS(t.elements.arrow),Xe=Be?w==="y"?Be.clientTop||0:Be.clientLeft||0:0,J=(F=O?.[w])!=null?F:0,ie=W+Ce-J-Xe,ge=W+Ue-J,Te=Mb(d?eC(G,ie):G,W,d?fp(Q,ge):Q);T[w]=Te,M[w]=Te-W}if(s){var Oe,Z=w==="x"?Ra:ka,oe=w==="x"?Us:Gs,ve=T[x],xe=x==="y"?"height":"width",Pe=ve+y[Z],ze=ve-y[oe],de=[Ra,ka].indexOf(m)!==-1,Ie=(Oe=O?.[x])!=null?Oe:0,it=de?Pe:ve-C[xe]-P[xe]-Ie+L.altAxis,Y=de?ve+C[xe]+P[xe]-Ie-L.altAxis:ze,D=d&&de?NCe(it,ve,Y):Mb(d?it:Pe,ve,d?Y:ze);T[x]=D,M[x]=D-ve}t.modifiersData[r]=M}}const dIe={name:"preventOverflow",enabled:!0,phase:"main",fn:fIe,requiresIfExists:["offset"]};function hIe(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function pIe(e){return e===rs(e)||!Ls(e)?B5(e):hIe(e)}function vIe(e){var t=e.getBoundingClientRect(),n=Am(t.width)/e.offsetWidth||1,r=Am(t.height)/e.offsetHeight||1;return n!==1||r!==1}function gIe(e,t,n){n===void 0&&(n=!1);var r=Ls(t),i=Ls(t)&&vIe(t),o=Cd(t),a=Rm(e,i,n),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(r||!r&&!n)&&((Tu(t)!=="body"||U5(o))&&(s=pIe(t)),Ls(t)?(l=Rm(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):o&&(l.x=V5(o))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function mIe(e){var t=new Map,n=new Set,r=[];e.forEach(function(o){t.set(o.name,o)});function i(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var l=t.get(s);l&&i(l)}}),r.push(o)}return e.forEach(function(o){n.has(o.name)||i(o)}),r}function yIe(e){var t=mIe(e);return kCe.reduce(function(n,r){return n.concat(t.filter(function(i){return i.phase===r}))},[])}function bIe(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function _Ie(e){var t=e.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(t).map(function(n){return t[n]})}var M6={placement:"bottom",modifiers:[],strategy:"absolute"};function F6(){for(var e=arguments.length,t=new Array(e),n=0;n-1}function VJ(e,t){return typeof e=="function"?e.apply(void 0,t):e}function $6(e,t){if(t===0)return e;var n;return function(r){clearTimeout(n),n=setTimeout(function(){e(r)},t)}}function CIe(e){return e.split(/\s+/).filter(Boolean)}function sg(e){return[].concat(e)}function B6(e,t){e.indexOf(t)===-1&&e.push(t)}function IIe(e){return e.filter(function(t,n){return e.indexOf(t)===n})}function AIe(e){return e.split("-")[0]}function tC(e){return[].slice.call(e)}function V6(e){return Object.keys(e).reduce(function(t,n){return e[n]!==void 0&&(t[n]=e[n]),t},{})}function $b(){return document.createElement("div")}function HI(e){return["Element","Fragment"].some(function(t){return G5(e,t)})}function RIe(e){return G5(e,"NodeList")}function kIe(e){return G5(e,"MouseEvent")}function PIe(e){return!!(e&&e._tippy&&e._tippy.reference===e)}function DIe(e){return HI(e)?[e]:RIe(e)?tC(e):Array.isArray(e)?e:tC(document.querySelectorAll(e))}function ik(e,t){e.forEach(function(n){n&&(n.style.transitionDuration=t+"ms")})}function U6(e,t){e.forEach(function(n){n&&n.setAttribute("data-state",t)})}function OIe(e){var t,n=sg(e),r=n[0];return r!=null&&(t=r.ownerDocument)!=null&&t.body?r.ownerDocument:document}function LIe(e,t){var n=t.clientX,r=t.clientY;return e.every(function(i){var o=i.popperRect,a=i.popperState,s=i.props,l=s.interactiveBorder,u=AIe(a.placement),c=a.modifiersData.offset;if(!c)return!0;var f=u==="bottom"?c.top.y:0,h=u==="top"?c.bottom.y:0,d=u==="right"?c.left.x:0,p=u==="left"?c.right.x:0,v=o.top-r+f>l,y=r-o.bottom-h>l,m=o.left-n+d>l,b=n-o.right-p>l;return v||y||m||b})}function ok(e,t,n){var r=t+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){e[r](i,n)})}function G6(e,t){for(var n=t;n;){var r;if(e.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Jl={isTouch:!1},H6=0;function NIe(){Jl.isTouch||(Jl.isTouch=!0,window.performance&&document.addEventListener("mousemove",UJ))}function UJ(){var e=performance.now();e-H6<20&&(Jl.isTouch=!1,document.removeEventListener("mousemove",UJ)),H6=e}function MIe(){var e=document.activeElement;if(PIe(e)){var t=e._tippy;e.blur&&!t.state.isVisible&&e.blur()}}function FIe(){document.addEventListener("touchstart",NIe,Rh),window.addEventListener("blur",MIe)}var $Ie=typeof window<"u"&&typeof document<"u",BIe=$Ie?!!window.msCrypto:!1,VIe={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},UIe={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},ll=Object.assign({appendTo:BJ,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},VIe,UIe),GIe=Object.keys(ll),HIe=function(t){var n=Object.keys(t);n.forEach(function(r){ll[r]=t[r]})};function GJ(e){var t=e.plugins||[],n=t.reduce(function(r,i){var o=i.name,a=i.defaultValue;if(o){var s;r[o]=e[o]!==void 0?e[o]:(s=ll[o])!=null?s:a}return r},{});return Object.assign({},e,n)}function WIe(e,t){var n=t?Object.keys(GJ(Object.assign({},ll,{plugins:t}))):GIe,r=n.reduce(function(i,o){var a=(e.getAttribute("data-tippy-"+o)||"").trim();if(!a)return i;if(o==="content")i[o]=a;else try{i[o]=JSON.parse(a)}catch{i[o]=a}return i},{});return r}function W6(e,t){var n=Object.assign({},t,{content:VJ(t.content,[e])},t.ignoreAttributes?{}:WIe(e,t.plugins));return n.aria=Object.assign({},ll.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?t.interactive:n.aria.expanded,content:n.aria.content==="auto"?t.interactive?null:"describedby":n.aria.content},n}var zIe=function(){return"innerHTML"};function $O(e,t){e[zIe()]=t}function z6(e){var t=$b();return e===!0?t.className=FJ:(t.className=$J,HI(e)?t.appendChild(e):$O(t,e)),t}function Y6(e,t){HI(t.content)?($O(e,""),e.appendChild(t.content)):typeof t.content!="function"&&(t.allowHTML?$O(e,t.content):e.textContent=t.content)}function BO(e){var t=e.firstElementChild,n=tC(t.children);return{box:t,content:n.find(function(r){return r.classList.contains(MJ)}),arrow:n.find(function(r){return r.classList.contains(FJ)||r.classList.contains($J)}),backdrop:n.find(function(r){return r.classList.contains(EIe)})}}function HJ(e){var t=$b(),n=$b();n.className=TIe,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=$b();r.className=MJ,r.setAttribute("data-state","hidden"),Y6(r,e.props),t.appendChild(n),n.appendChild(r),i(e.props,e.props);function i(o,a){var s=BO(t),l=s.box,u=s.content,c=s.arrow;a.theme?l.setAttribute("data-theme",a.theme):l.removeAttribute("data-theme"),typeof a.animation=="string"?l.setAttribute("data-animation",a.animation):l.removeAttribute("data-animation"),a.inertia?l.setAttribute("data-inertia",""):l.removeAttribute("data-inertia"),l.style.maxWidth=typeof a.maxWidth=="number"?a.maxWidth+"px":a.maxWidth,a.role?l.setAttribute("role",a.role):l.removeAttribute("role"),(o.content!==a.content||o.allowHTML!==a.allowHTML)&&Y6(u,e.props),a.arrow?c?o.arrow!==a.arrow&&(l.removeChild(c),l.appendChild(z6(a.arrow))):l.appendChild(z6(a.arrow)):c&&l.removeChild(c)}return{popper:t,onUpdate:i}}HJ.$$tippy=!0;var YIe=1,Mw=[],ak=[];function jIe(e,t){var n=W6(e,Object.assign({},ll,GJ(V6(t)))),r,i,o,a=!1,s=!1,l=!1,u=!1,c,f,h,d=[],p=$6(ie,n.interactiveDebounce),v,y=YIe++,m=null,b=IIe(n.plugins),S={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},w={id:y,reference:e,popper:$b(),popperInstance:m,props:n,state:S,plugins:b,clearDelayTimeouts:it,setProps:Y,setContent:D,show:A,hide:H,hideWithInteractivity:q,enable:de,disable:Ie,unmount:le,destroy:_e};if(!n.render)return w;var x=n.render(w),T=x.popper,C=x.onUpdate;T.setAttribute("data-tippy-root",""),T.id="tippy-"+w.id,w.popper=T,e._tippy=w,T._tippy=w;var P=b.map(function(he){return he.fn(w)}),k=e.hasAttribute("aria-expanded");return Be(),ne(),W(),G("onCreate",[w]),n.showOnCreate&&Pe(),T.addEventListener("mouseenter",function(){w.props.interactive&&w.state.isVisible&&w.clearDelayTimeouts()}),T.addEventListener("mouseleave",function(){w.props.interactive&&w.props.trigger.indexOf("mouseenter")>=0&&U().addEventListener("mousemove",p)}),w;function L(){var he=w.props.touch;return Array.isArray(he)?he:[he,0]}function O(){return L()[0]==="hold"}function M(){var he;return!!((he=w.props.render)!=null&&he.$$tippy)}function F(){return v||e}function U(){var he=F().parentNode;return he?OIe(he):document}function X(){return BO(T)}function $(he){return w.state.isMounted&&!w.state.isVisible||Jl.isTouch||c&&c.type==="focus"?0:rk(w.props.delay,he?0:1,ll.delay)}function W(he){he===void 0&&(he=!1),T.style.pointerEvents=w.props.interactive&&!he?"":"none",T.style.zIndex=""+w.props.zIndex}function G(he,Ge,He){if(He===void 0&&(He=!0),P.forEach(function(je){je[he]&&je[he].apply(je,Ge)}),He){var rt;(rt=w.props)[he].apply(rt,Ge)}}function Q(){var he=w.props.aria;if(he.content){var Ge="aria-"+he.content,He=T.id,rt=sg(w.props.triggerTarget||e);rt.forEach(function(je){var ut=je.getAttribute(Ge);if(w.state.isVisible)je.setAttribute(Ge,ut?ut+" "+He:He);else{var St=ut&&ut.replace(He,"").trim();St?je.setAttribute(Ge,St):je.removeAttribute(Ge)}})}}function ne(){if(!(k||!w.props.aria.expanded)){var he=sg(w.props.triggerTarget||e);he.forEach(function(Ge){w.props.interactive?Ge.setAttribute("aria-expanded",w.state.isVisible&&Ge===F()?"true":"false"):Ge.removeAttribute("aria-expanded")})}}function re(){U().removeEventListener("mousemove",p),Mw=Mw.filter(function(he){return he!==p})}function pe(he){if(!(Jl.isTouch&&(l||he.type==="mousedown"))){var Ge=he.composedPath&&he.composedPath()[0]||he.target;if(!(w.props.interactive&&G6(T,Ge))){if(sg(w.props.triggerTarget||e).some(function(He){return G6(He,Ge)})){if(Jl.isTouch||w.state.isVisible&&w.props.trigger.indexOf("click")>=0)return}else G("onClickOutside",[w,he]);w.props.hideOnClick===!0&&(w.clearDelayTimeouts(),w.hide(),s=!0,setTimeout(function(){s=!1}),w.state.isMounted||be())}}}function ke(){l=!0}function Re(){l=!1}function Me(){var he=U();he.addEventListener("mousedown",pe,!0),he.addEventListener("touchend",pe,Rh),he.addEventListener("touchstart",Re,Rh),he.addEventListener("touchmove",ke,Rh)}function be(){var he=U();he.removeEventListener("mousedown",pe,!0),he.removeEventListener("touchend",pe,Rh),he.removeEventListener("touchstart",Re,Rh),he.removeEventListener("touchmove",ke,Rh)}function fe(he,Ge){Ce(he,function(){!w.state.isVisible&&T.parentNode&&T.parentNode.contains(T)&&Ge()})}function Le(he,Ge){Ce(he,Ge)}function Ce(he,Ge){var He=X().box;function rt(je){je.target===He&&(ok(He,"remove",rt),Ge())}if(he===0)return Ge();ok(He,"remove",f),ok(He,"add",rt),f=rt}function Ue(he,Ge,He){He===void 0&&(He=!1);var rt=sg(w.props.triggerTarget||e);rt.forEach(function(je){je.addEventListener(he,Ge,He),d.push({node:je,eventType:he,handler:Ge,options:He})})}function Be(){O()&&(Ue("touchstart",J,{passive:!0}),Ue("touchend",ge,{passive:!0})),CIe(w.props.trigger).forEach(function(he){if(he!=="manual")switch(Ue(he,J),he){case"mouseenter":Ue("mouseleave",ge);break;case"focus":Ue(BIe?"focusout":"blur",Te);break;case"focusin":Ue("focusout",Te);break}})}function Xe(){d.forEach(function(he){var Ge=he.node,He=he.eventType,rt=he.handler,je=he.options;Ge.removeEventListener(He,rt,je)}),d=[]}function J(he){var Ge,He=!1;if(!(!w.state.isEnabled||Oe(he)||s)){var rt=((Ge=c)==null?void 0:Ge.type)==="focus";c=he,v=he.currentTarget,ne(),!w.state.isVisible&&kIe(he)&&Mw.forEach(function(je){return je(he)}),he.type==="click"&&(w.props.trigger.indexOf("mouseenter")<0||a)&&w.props.hideOnClick!==!1&&w.state.isVisible?He=!0:Pe(he),he.type==="click"&&(a=!He),He&&!rt&&ze(he)}}function ie(he){var Ge=he.target,He=F().contains(Ge)||T.contains(Ge);if(!(he.type==="mousemove"&&He)){var rt=xe().concat(T).map(function(je){var ut,St=je._tippy,Kt=(ut=St.popperInstance)==null?void 0:ut.state;return Kt?{popperRect:je.getBoundingClientRect(),popperState:Kt,props:n}:null}).filter(Boolean);LIe(rt,he)&&(re(),ze(he))}}function ge(he){var Ge=Oe(he)||w.props.trigger.indexOf("click")>=0&&a;if(!Ge){if(w.props.interactive){w.hideWithInteractivity(he);return}ze(he)}}function Te(he){w.props.trigger.indexOf("focusin")<0&&he.target!==F()||w.props.interactive&&he.relatedTarget&&T.contains(he.relatedTarget)||ze(he)}function Oe(he){return Jl.isTouch?O()!==he.type.indexOf("touch")>=0:!1}function Z(){oe();var he=w.props,Ge=he.popperOptions,He=he.placement,rt=he.offset,je=he.getReferenceClientRect,ut=he.moveTransition,St=M()?BO(T).arrow:null,Kt=je?{getBoundingClientRect:je,contextElement:je.contextElement||F()}:e,on={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(yi){var si=yi.state;if(M()){var Rd=X(),Rl=Rd.box;["placement","reference-hidden","escaped"].forEach(function(Kc){Kc==="placement"?Rl.setAttribute("data-placement",si.placement):si.attributes.popper["data-popper-"+Kc]?Rl.setAttribute("data-"+Kc,""):Rl.removeAttribute("data-"+Kc)}),si.attributes.popper={}}}},zn=[{name:"offset",options:{offset:rt}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ut}},on];M()&&St&&zn.push({name:"arrow",options:{element:St,padding:3}}),zn.push.apply(zn,Ge?.modifiers||[]),w.popperInstance=xIe(Kt,T,Object.assign({},Ge,{placement:He,onFirstUpdate:h,modifiers:zn}))}function oe(){w.popperInstance&&(w.popperInstance.destroy(),w.popperInstance=null)}function ve(){var he=w.props.appendTo,Ge,He=F();w.props.interactive&&he===BJ||he==="parent"?Ge=He.parentNode:Ge=VJ(he,[He]),Ge.contains(T)||Ge.appendChild(T),w.state.isMounted=!0,Z()}function xe(){return tC(T.querySelectorAll("[data-tippy-root]"))}function Pe(he){w.clearDelayTimeouts(),he&&G("onTrigger",[w,he]),Me();var Ge=$(!0),He=L(),rt=He[0],je=He[1];Jl.isTouch&&rt==="hold"&&je&&(Ge=je),Ge?r=setTimeout(function(){w.show()},Ge):w.show()}function ze(he){if(w.clearDelayTimeouts(),G("onUntrigger",[w,he]),!w.state.isVisible){be();return}if(!(w.props.trigger.indexOf("mouseenter")>=0&&w.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(he.type)>=0&&a)){var Ge=$(!1);Ge?i=setTimeout(function(){w.state.isVisible&&w.hide()},Ge):o=requestAnimationFrame(function(){w.hide()})}}function de(){w.state.isEnabled=!0}function Ie(){w.hide(),w.state.isEnabled=!1}function it(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(o)}function Y(he){if(!w.state.isDestroyed){G("onBeforeUpdate",[w,he]),Xe();var Ge=w.props,He=W6(e,Object.assign({},Ge,V6(he),{ignoreAttributes:!0}));w.props=He,Be(),Ge.interactiveDebounce!==He.interactiveDebounce&&(re(),p=$6(ie,He.interactiveDebounce)),Ge.triggerTarget&&!He.triggerTarget?sg(Ge.triggerTarget).forEach(function(rt){rt.removeAttribute("aria-expanded")}):He.triggerTarget&&e.removeAttribute("aria-expanded"),ne(),W(),C&&C(Ge,He),w.popperInstance&&(Z(),xe().forEach(function(rt){requestAnimationFrame(rt._tippy.popperInstance.forceUpdate)})),G("onAfterUpdate",[w,he])}}function D(he){w.setProps({content:he})}function A(){var he=w.state.isVisible,Ge=w.state.isDestroyed,He=!w.state.isEnabled,rt=Jl.isTouch&&!w.props.touch,je=rk(w.props.duration,0,ll.duration);if(!(he||Ge||He||rt)&&!F().hasAttribute("disabled")&&(G("onShow",[w],!1),w.props.onShow(w)!==!1)){if(w.state.isVisible=!0,M()&&(T.style.visibility="visible"),W(),Me(),w.state.isMounted||(T.style.transition="none"),M()){var ut=X(),St=ut.box,Kt=ut.content;ik([St,Kt],0)}h=function(){var zn;if(!(!w.state.isVisible||u)){if(u=!0,T.offsetHeight,T.style.transition=w.props.moveTransition,M()&&w.props.animation){var ra=X(),yi=ra.box,si=ra.content;ik([yi,si],je),U6([yi,si],"visible")}Q(),ne(),B6(ak,w),(zn=w.popperInstance)==null||zn.forceUpdate(),G("onMount",[w]),w.props.animation&&M()&&Le(je,function(){w.state.isShown=!0,G("onShown",[w])})}},ve()}}function H(){var he=!w.state.isVisible,Ge=w.state.isDestroyed,He=!w.state.isEnabled,rt=rk(w.props.duration,1,ll.duration);if(!(he||Ge||He)&&(G("onHide",[w],!1),w.props.onHide(w)!==!1)){if(w.state.isVisible=!1,w.state.isShown=!1,u=!1,a=!1,M()&&(T.style.visibility="hidden"),re(),be(),W(!0),M()){var je=X(),ut=je.box,St=je.content;w.props.animation&&(ik([ut,St],rt),U6([ut,St],"hidden"))}Q(),ne(),w.props.animation?M()&&fe(rt,w.unmount):w.unmount()}}function q(he){U().addEventListener("mousemove",p),B6(Mw,p),p(he)}function le(){w.state.isVisible&&w.hide(),w.state.isMounted&&(oe(),xe().forEach(function(he){he._tippy.unmount()}),T.parentNode&&T.parentNode.removeChild(T),ak=ak.filter(function(he){return he!==w}),w.state.isMounted=!1,G("onHidden",[w]))}function _e(){w.state.isDestroyed||(w.clearDelayTimeouts(),w.unmount(),Xe(),delete e._tippy,w.state.isDestroyed=!0,G("onDestroy",[w]))}}function oS(e,t){t===void 0&&(t={});var n=ll.plugins.concat(t.plugins||[]);FIe();var r=Object.assign({},t,{plugins:n}),i=DIe(e),o=i.reduce(function(a,s){var l=s&&jIe(s,r);return l&&a.push(l),a},[]);return HI(e)?o[0]:o}oS.defaultProps=ll;oS.setDefaultProps=HIe;oS.currentInput=Jl;Object.assign({},AJ,{effect:function(t){var n=t.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}});oS.setDefaultProps({render:HJ});let sk,Rv=null,lk=null;const mi=()=>(sk||(sk=document.getElementById("app-content")),{showTip:(r,i,o={})=>{lk!==r.currentTarget&&(Rv?.destroy(),Rv=oS(r.currentTarget,{content:i,placement:"top",animation:"scale",appendTo:sk,allowHTML:!0,showOnCreate:!0,onHidden:()=>{Rv?.destroy(),Rv=null,lk=null},popperOptions:{modifiers:[{name:"preventOverflow",options:{boundary:"clippingParents",padding:8}},{name:"flip",options:{fallbackPlacements:["top","bottom","right","left"]}}]},...o}),lk=r.currentTarget)},hideTip:()=>{Rv?.hide()},updateTip:r=>{Rv?.setContent(r)}}),{showTip:XIe}=mi(),ou=e=>{const t=e.target,{scrollWidth:n,clientWidth:r}=t;n>r&&XIe(e,t.innerText,{delay:[700,0],trigger:"mouseenter",touch:["hold",500]})},my=Ye({__name:"CtrlsBar",props:{solid:{type:Boolean}},setup(e){const t=me(null),{bottom:n}=_X(t);return et(n,()=>{Gg.value=n.value},{immediate:!0}),Do(()=>{Gg.value=0}),(r,i)=>(V(),j("div",{class:tt(["bg-base-100 need-blur fixed top-0 right-0 left-0 z-30 shadow-xs backdrop-blur-xl",[R(ur)?"fixed":"sticky",{"md:bg-base-100/50":!e.solid}]]),ref_key:"ctrlsBarRef",ref:t},[Ea(r.$slots,"default")],2))}}),KIe={class:"relative"},ZIe=["placeholder","name","autocomplete"],kn=Ye({__name:"TextInput",props:p1({placeholder:{},beforeClose:{type:Boolean},name:{},autocomplete:{},clearable:{type:Boolean},inputClass:{},menus:{},menusDeleteable:{type:Boolean}},{modelValue:{},modelModifiers:{}}),emits:p1(["input","change","update:menus"],["update:modelValue"]),setup(e,{emit:t}){const n=t,r=e,i=Yc(e,"modelValue"),o=()=>{i.value=""},{showTip:a,hideTip:s}=mi(),l=me(),u=c=>{if(!r.menus?.length)return;const f=Ye({setup(){return()=>Wn("div",{class:"max-h-64 overflow-y-auto overflow-x-hidden scrollbar-hidden min-w-24 py-1"},(r.menus??[]).map(p=>Wn("div",{class:"cursor-pointer rounded-sm p-1 px-3 flex gap-2 items-center overflow-hidden hover:bg-base-300"},[Wn("span",{class:"flex-1 truncate",onClick:()=>{i.value=p,s(),l.value?.focus()}},p),r.menusDeleteable&&Wn(Ca,{class:"h-3 w-3 transition-transform hover:scale-125",onClick:()=>{const v=(r.menus??[]).filter(y=>y!==p);n("update:menus",v),v.length||s()}})])))}}),h=document.createElement("div");sm(f).mount(h),a(c,h,{theme:"base",placement:"bottom-start",trigger:"click",interactive:!0,appendTo:document.body,arrow:!1})};return(c,f)=>(V(),j("div",KIe,[e.beforeClose&&e.clearable?(V(),j("button",{key:0,class:"btn btn-ghost btn-circle btn-xs absolute top-1/2 right-1 z-10 h-5 min-h-5 w-5 -translate-y-1/2 p-0",onClick:o},[B(R(Ca),{class:"h-3 w-3"})])):Fe("",!0),at(I("input",{"onUpdate:modelValue":f[0]||(f[0]=h=>i.value=h),ref_key:"inputRef",ref:l,type:"text",class:tt(["input input-sm join-item w-full",e.inputClass,{"pr-6":e.clearable}]),placeholder:e.placeholder||"",name:e.name||"",autocomplete:e.autocomplete||"",onClick:u,onInput:f[1]||(f[1]=h=>(n("input",i.value||""),R(s)())),onChange:f[2]||(f[2]=h=>n("change",i.value||""))},null,42,ZIe),[[Mr,i.value]]),!e.beforeClose&&e.clearable?(V(),j("button",{key:1,class:"btn btn-ghost btn-circle btn-xs absolute top-1/2 right-1 h-5 min-h-5 w-5 -translate-y-1/2 p-0",onClick:o},[B(R(Ca),{class:"h-3 w-3"})])):Fe("",!0)]))}});var $T={exports:{}},uk={exports:{}},ck={};const Pm=Symbol(""),Hg=Symbol(""),WI=Symbol(""),W1=Symbol(""),H5=Symbol(""),dd=Symbol(""),W5=Symbol(""),z5=Symbol(""),zI=Symbol(""),YI=Symbol(""),yy=Symbol(""),jI=Symbol(""),Y5=Symbol(""),XI=Symbol(""),KI=Symbol(""),ZI=Symbol(""),JI=Symbol(""),QI=Symbol(""),qI=Symbol(""),j5=Symbol(""),X5=Symbol(""),aS=Symbol(""),z1=Symbol(""),eA=Symbol(""),tA=Symbol(""),Dm=Symbol(""),by=Symbol(""),nA=Symbol(""),nC=Symbol(""),WJ=Symbol(""),rC=Symbol(""),Y1=Symbol(""),zJ=Symbol(""),YJ=Symbol(""),rA=Symbol(""),jJ=Symbol(""),XJ=Symbol(""),iA=Symbol(""),K5=Symbol(""),Rp={[Pm]:"Fragment",[Hg]:"Teleport",[WI]:"Suspense",[W1]:"KeepAlive",[H5]:"BaseTransition",[dd]:"openBlock",[W5]:"createBlock",[z5]:"createElementBlock",[zI]:"createVNode",[YI]:"createElementVNode",[yy]:"createCommentVNode",[jI]:"createTextVNode",[Y5]:"createStaticVNode",[XI]:"resolveComponent",[KI]:"resolveDynamicComponent",[ZI]:"resolveDirective",[JI]:"resolveFilter",[QI]:"withDirectives",[qI]:"renderList",[j5]:"renderSlot",[X5]:"createSlots",[aS]:"toDisplayString",[z1]:"mergeProps",[eA]:"normalizeClass",[tA]:"normalizeStyle",[Dm]:"normalizeProps",[by]:"guardReactiveProps",[nA]:"toHandlers",[nC]:"camelize",[WJ]:"capitalize",[rC]:"toHandlerKey",[Y1]:"setBlockTracking",[zJ]:"pushScopeId",[YJ]:"popScopeId",[rA]:"withCtx",[jJ]:"unref",[XJ]:"isRef",[iA]:"withMemo",[K5]:"isMemoSame"};function KJ(e){Object.getOwnPropertySymbols(e).forEach(t=>{Rp[t]=e[t]})}const JIe={HTML:0,0:"HTML",SVG:1,1:"SVG",MATH_ML:2,2:"MATH_ML"},QIe={ROOT:0,0:"ROOT",ELEMENT:1,1:"ELEMENT",TEXT:2,2:"TEXT",COMMENT:3,3:"COMMENT",SIMPLE_EXPRESSION:4,4:"SIMPLE_EXPRESSION",INTERPOLATION:5,5:"INTERPOLATION",ATTRIBUTE:6,6:"ATTRIBUTE",DIRECTIVE:7,7:"DIRECTIVE",COMPOUND_EXPRESSION:8,8:"COMPOUND_EXPRESSION",IF:9,9:"IF",IF_BRANCH:10,10:"IF_BRANCH",FOR:11,11:"FOR",TEXT_CALL:12,12:"TEXT_CALL",VNODE_CALL:13,13:"VNODE_CALL",JS_CALL_EXPRESSION:14,14:"JS_CALL_EXPRESSION",JS_OBJECT_EXPRESSION:15,15:"JS_OBJECT_EXPRESSION",JS_PROPERTY:16,16:"JS_PROPERTY",JS_ARRAY_EXPRESSION:17,17:"JS_ARRAY_EXPRESSION",JS_FUNCTION_EXPRESSION:18,18:"JS_FUNCTION_EXPRESSION",JS_CONDITIONAL_EXPRESSION:19,19:"JS_CONDITIONAL_EXPRESSION",JS_CACHE_EXPRESSION:20,20:"JS_CACHE_EXPRESSION",JS_BLOCK_STATEMENT:21,21:"JS_BLOCK_STATEMENT",JS_TEMPLATE_LITERAL:22,22:"JS_TEMPLATE_LITERAL",JS_IF_STATEMENT:23,23:"JS_IF_STATEMENT",JS_ASSIGNMENT_EXPRESSION:24,24:"JS_ASSIGNMENT_EXPRESSION",JS_SEQUENCE_EXPRESSION:25,25:"JS_SEQUENCE_EXPRESSION",JS_RETURN_STATEMENT:26,26:"JS_RETURN_STATEMENT"},qIe={ELEMENT:0,0:"ELEMENT",COMPONENT:1,1:"COMPONENT",SLOT:2,2:"SLOT",TEMPLATE:3,3:"TEMPLATE"},eAe={NOT_CONSTANT:0,0:"NOT_CONSTANT",CAN_SKIP_PATCH:1,1:"CAN_SKIP_PATCH",CAN_CACHE:2,2:"CAN_CACHE",CAN_STRINGIFY:3,3:"CAN_STRINGIFY"},ki={start:{line:1,column:1,offset:0},end:{line:1,column:1,offset:0},source:""};function ZJ(e,t=""){return{type:0,source:t,children:e,helpers:new Set,components:[],directives:[],hoists:[],imports:[],cached:[],temps:0,codegenNode:void 0,loc:ki}}function Om(e,t,n,r,i,o,a,s=!1,l=!1,u=!1,c=ki){return e&&(s?(e.helper(dd),e.helper(Dp(e.inSSR,u))):e.helper(Pp(e.inSSR,u)),a&&e.helper(QI)),{type:13,tag:t,props:n,children:r,patchFlag:i,dynamicProps:o,directives:a,isBlock:s,disableTracking:l,isComponent:u,loc:c}}function qf(e,t=ki){return{type:17,loc:t,elements:e}}function Ja(e,t=ki){return{type:15,loc:t,properties:e}}function oi(e,t){return{type:16,loc:ki,key:zt(e)?en(e,!0):e,value:t}}function en(e,t=!1,n=ki,r=0){return{type:4,loc:n,content:e,isStatic:t,constType:t?3:r}}function tAe(e,t){return{type:5,loc:t,content:zt(e)?en(e,!1,t):e}}function Ns(e,t=ki){return{type:8,loc:t,children:e}}function di(e,t=[],n=ki){return{type:14,loc:n,callee:e,arguments:t}}function kp(e,t=void 0,n=!1,r=!1,i=ki){return{type:18,params:e,returns:t,newline:n,isSlot:r,loc:i}}function iC(e,t,n,r=!0){return{type:19,test:e,consequent:t,alternate:n,newline:r,loc:ki}}function JJ(e,t,n=!1,r=!1){return{type:20,index:e,value:t,needPauseTracking:n,inVOnce:r,needArraySpread:!1,loc:ki}}function QJ(e){return{type:21,body:e,loc:ki}}function nAe(e){return{type:22,elements:e,loc:ki}}function rAe(e,t,n){return{type:23,test:e,consequent:t,alternate:n,loc:ki}}function iAe(e,t){return{type:24,left:e,right:t,loc:ki}}function oAe(e){return{type:25,expressions:e,loc:ki}}function aAe(e){return{type:26,returns:e,loc:ki}}function Pp(e,t){return e||t?zI:YI}function Dp(e,t){return e||t?W5:z5}function oA(e,{helper:t,removeHelper:n,inSSR:r}){e.isBlock||(e.isBlock=!0,n(Pp(r,e.isComponent)),t(dd),t(Dp(r,e.isComponent)))}const j6=new Uint8Array([123,123]),X6=new Uint8Array([125,125]);function K6(e){return e>=97&&e<=122||e>=65&&e<=90}function ja(e){return e===32||e===10||e===9||e===12||e===13}function cf(e){return e===47||e===62||ja(e)}function oC(e){const t=new Uint8Array(e.length);for(let n=0;n100){let a=-1,s=i;for(;a+1>>1;this.newlines[l]=0;a--)if(t>this.newlines[a]){o=a;break}return o>=0&&(n=o+2,r=t-this.newlines[o]),{column:r,line:n,offset:t}}peek(){return this.buffer.charCodeAt(this.index+1)}stateText(t){t===60?(this.index>this.sectionStart&&this.cbs.ontext(this.sectionStart,this.index),this.state=5,this.sectionStart=this.index):!this.inVPre&&t===this.delimiterOpen[0]&&(this.state=2,this.delimiterIndex=0,this.stateInterpolationOpen(t))}stateInterpolationOpen(t){if(t===this.delimiterOpen[this.delimiterIndex])if(this.delimiterIndex===this.delimiterOpen.length-1){const n=this.index+1-this.delimiterOpen.length;n>this.sectionStart&&this.cbs.ontext(this.sectionStart,n),this.state=3,this.sectionStart=n}else this.delimiterIndex++;else this.inRCDATA?(this.state=32,this.stateInRCDATA(t)):(this.state=1,this.stateText(t))}stateInterpolation(t){t===this.delimiterClose[0]&&(this.state=4,this.delimiterIndex=0,this.stateInterpolationClose(t))}stateInterpolationClose(t){t===this.delimiterClose[this.delimiterIndex]?this.delimiterIndex===this.delimiterClose.length-1?(this.cbs.oninterpolation(this.sectionStart,this.index+1),this.inRCDATA?this.state=32:this.state=1,this.sectionStart=this.index+1):this.delimiterIndex++:(this.state=3,this.stateInterpolation(t))}stateSpecialStartSequence(t){const n=this.sequenceIndex===this.currentSequence.length;if(!(n?cf(t):(t|32)===this.currentSequence[this.sequenceIndex]))this.inRCDATA=!1;else if(!n){this.sequenceIndex++;return}this.sequenceIndex=0,this.state=6,this.stateInTagName(t)}stateInRCDATA(t){if(this.sequenceIndex===this.currentSequence.length){if(t===62||ja(t)){const n=this.index-this.currentSequence.length;if(this.sectionStart=t||(this.state===28?this.currentSequence===uo.CdataEnd?this.cbs.oncdata(this.sectionStart,t):this.cbs.oncomment(this.sectionStart,t):this.state===6||this.state===11||this.state===18||this.state===17||this.state===12||this.state===13||this.state===14||this.state===15||this.state===16||this.state===20||this.state===19||this.state===21||this.state===9||this.cbs.ontext(this.sectionStart,t))}emitCodePoint(t,n){}}const lAe={COMPILER_IS_ON_ELEMENT:"COMPILER_IS_ON_ELEMENT",COMPILER_V_BIND_SYNC:"COMPILER_V_BIND_SYNC",COMPILER_V_BIND_OBJECT_ORDER:"COMPILER_V_BIND_OBJECT_ORDER",COMPILER_V_ON_NATIVE:"COMPILER_V_ON_NATIVE",COMPILER_V_IF_V_FOR_PRECEDENCE:"COMPILER_V_IF_V_FOR_PRECEDENCE",COMPILER_NATIVE_TEMPLATE:"COMPILER_NATIVE_TEMPLATE",COMPILER_INLINE_TEMPLATE:"COMPILER_INLINE_TEMPLATE",COMPILER_FILTERS:"COMPILER_FILTERS"},uAe={COMPILER_IS_ON_ELEMENT:{message:'Platform-native elements with "is" prop will no longer be treated as components in Vue 3 unless the "is" value is explicitly prefixed with "vue:".',link:"https://v3-migration.vuejs.org/breaking-changes/custom-elements-interop.html"},COMPILER_V_BIND_SYNC:{message:e=>`.sync modifier for v-bind has been removed. Use v-model with argument instead. \`v-bind:${e}.sync\` should be changed to \`v-model:${e}\`.`,link:"https://v3-migration.vuejs.org/breaking-changes/v-model.html"},COMPILER_V_BIND_OBJECT_ORDER:{message:'v-bind="obj" usage is now order sensitive and behaves like JavaScript object spread: it will now overwrite an existing non-mergeable attribute that appears before v-bind in the case of conflict. To retain 2.x behavior, move v-bind to make it the first attribute. You can also suppress this warning if the usage is intended.',link:"https://v3-migration.vuejs.org/breaking-changes/v-bind.html"},COMPILER_V_ON_NATIVE:{message:".native modifier for v-on has been removed as is no longer necessary.",link:"https://v3-migration.vuejs.org/breaking-changes/v-on-native-modifier-removed.html"},COMPILER_V_IF_V_FOR_PRECEDENCE:{message:"v-if / v-for precedence when used on the same element has changed in Vue 3: v-if now takes higher precedence and will no longer have access to v-for scope variables. It is best to avoid the ambiguity with